From: NeilBrown Date: Wed, 30 May 2012 03:08:39 +0000 (+1000) Subject: Detail: show which 'set' each device in a RAID10 belongs to X-Git-Tag: mdadm-3.3-rc1~298 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c096ebe4b8f38faf701286852dbfd5939cfee47;p=thirdparty%2Fmdadm.git Detail: show which 'set' each device in a RAID10 belongs to A RAID10 can be though of as having 2 sets of devices (if there are 2 copies and an even number of devices in total). With this patch "mdadm --detail" shows which 'set' each device belongs to - set-A or set-B. If there are more than 3 copies, there can be more than 3 sets. If the number of copies does not evenly divide the number of devices, there are not distinct 'sets' so none are reported. Signed-off-by: NeilBrown --- diff --git a/Detail.c b/Detail.c index ae15846d..abe8e2f1 100644 --- a/Detail.c +++ b/Detail.c @@ -533,7 +533,19 @@ This is pretty boring failed++; } if (disk.state & (1<> 8) & 0xff; + int copies = nc*fc; + if (array.raid_disks % copies == 0 && copies <= 26) { + /* We can divide the devices into 'sets' */ + int set = disk.raid_disk % copies; + printf(" set-%c", set + 'A'); + } + } + } if (disk.state & (1<