[PATCH 15/16] imsm Fix: Core during rebuild on array details read

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

 



When rebuild/reshape is in progress, executing mdadm for read array details causes core dump.
This is due to not initialized devices list pointer in getinfo_super() call.
Initializing it to NULL value allows code to detect such situation.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 Detail.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Detail.c b/Detail.c
index 9415628..836f153 100644
--- a/Detail.c
+++ b/Detail.c
@@ -147,7 +147,10 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
 			info = st->ss->container_content(st, subarray);
 		else {
 			info = malloc(sizeof(*info));
-			st->ss->getinfo_super(st, info, NULL);
+			if (info) {
+				info->devs = NULL;
+				st->ss->getinfo_super(st, info, NULL);
+			}
 		}
 		if (!info)
 			continue;

--
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