|
|
2c1b57 |
From 230a0dde0926125b8895e02a669b4701f79c0f07 Mon Sep 17 00:00:00 2001
|
|
|
2c1b57 |
From: Zhilong Liu <zlliu@suse.com>
|
|
|
2c1b57 |
Date: Sat, 1 Apr 2017 20:51:44 +0800
|
|
|
2c1b57 |
Subject: [RHEL7.5 PATCH 049/169] mdadm/Create: declaring an existing
|
|
|
2c1b57 |
struct within same function
|
|
|
2c1b57 |
|
|
|
2c1b57 |
Create:declaring 'struct stat stb' twice within the same
|
|
|
2c1b57 |
function, rename stb as stb2 when declares 'struct stat'
|
|
|
2c1b57 |
at the second time.
|
|
|
2c1b57 |
|
|
|
2c1b57 |
Signed-off-by: Zhilong Liu <zlliu@suse.com>
|
|
|
2c1b57 |
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
|
|
|
2c1b57 |
---
|
|
|
2c1b57 |
Create.c | 12 ++++++------
|
|
|
2c1b57 |
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
2c1b57 |
|
|
|
2c1b57 |
diff --git a/Create.c b/Create.c
|
|
|
2c1b57 |
index 32987af..ba24606 100644
|
|
|
2c1b57 |
--- a/Create.c
|
|
|
2c1b57 |
+++ b/Create.c
|
|
|
2c1b57 |
@@ -868,7 +868,7 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
for (dnum=0, raid_disk_num=0, dv = devlist ; dv ;
|
|
|
2c1b57 |
dv=(dv->next)?(dv->next):moved_disk, dnum++) {
|
|
|
2c1b57 |
int fd;
|
|
|
2c1b57 |
- struct stat stb;
|
|
|
2c1b57 |
+ struct stat stb2;
|
|
|
2c1b57 |
struct mdinfo *inf = &infos[dnum];
|
|
|
2c1b57 |
|
|
|
2c1b57 |
if (dnum >= total_slots)
|
|
|
2c1b57 |
@@ -924,9 +924,9 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
dv->devname);
|
|
|
2c1b57 |
goto abort_locked;
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
- fstat(fd, &stb;;
|
|
|
2c1b57 |
- inf->disk.major = major(stb.st_rdev);
|
|
|
2c1b57 |
- inf->disk.minor = minor(stb.st_rdev);
|
|
|
2c1b57 |
+ fstat(fd, &stb2);
|
|
|
2c1b57 |
+ inf->disk.major = major(stb2.st_rdev);
|
|
|
2c1b57 |
+ inf->disk.minor = minor(stb2.st_rdev);
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
if (fd >= 0)
|
|
|
2c1b57 |
remove_partitions(fd);
|
|
|
2c1b57 |
@@ -947,8 +947,8 @@ int Create(struct supertype *st, char *mddev,
|
|
|
2c1b57 |
|
|
|
2c1b57 |
if (!have_container) {
|
|
|
2c1b57 |
/* getinfo_super might have lost these ... */
|
|
|
2c1b57 |
- inf->disk.major = major(stb.st_rdev);
|
|
|
2c1b57 |
- inf->disk.minor = minor(stb.st_rdev);
|
|
|
2c1b57 |
+ inf->disk.major = major(stb2.st_rdev);
|
|
|
2c1b57 |
+ inf->disk.minor = minor(stb2.st_rdev);
|
|
|
2c1b57 |
}
|
|
|
2c1b57 |
break;
|
|
|
2c1b57 |
case 2:
|
|
|
2c1b57 |
--
|
|
|
2c1b57 |
2.7.4
|
|
|
2c1b57 |
|