Re: [Patch v1] Detail: fix a bug when trying to show the detail of a raid device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Please ignore this patch. It has been fixed by Tomasz two days ago.
Sorry for the noise.

Thanks,
Lidong

On 05/26/2017 10:42 AM, Lidong Zhong wrote:
It's introduced from commit a4dcdb23ea63.

Signed-off-by: Lidong Zhong <lzhong@xxxxxxxx>
---
 Detail.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Detail.c b/Detail.c
index bf881ff..c89b927 100644
--- a/Detail.c
+++ b/Detail.c
@@ -98,8 +98,8 @@ int Detail(char *dev, struct context *c)
 		    sra->array.minor_version == -2);
 	inactive = (sra->array_state == ARRAY_ACTIVE ||
 		    sra->array_state == ARRAY_CLEAR);
-	st = super_by_fd(fd, &subarray);
-	if (md_get_array_info(fd, &array) && errno == ENODEV) {
+	rv = md_get_array_info(fd, &array);
+	if (rv && errno == ENODEV) {
 		if (sra->array.major_version == -1 &&
 		    sra->array.minor_version == -1 &&
 		    sra->devs == NULL) {
@@ -109,7 +109,7 @@ int Detail(char *dev, struct context *c)
 			return rv;
 		}
 		array = sra->array;
-	} else {
+	} else if (rv) {
 		pr_err("cannot get array detail for %s: %s\n",
 		       dev, strerror(errno));
 		close(fd);
@@ -118,8 +118,8 @@ int Detail(char *dev, struct context *c)

 	if (fstat(fd, &stb) != 0 && !S_ISBLK(stb.st_mode))
 		stb.st_rdev = 0;
-	rv = 0;

+	st = super_by_fd(fd, &subarray);
 	if (st)
 		max_disks = st->max_devs;


--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux