From 4ebd3237119b1c1d701ea0c94795631883e449ed Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 30 Oct 2008 16:37:29 +1100 Subject: Adjust major number testing to allow for extended minor number in 2.6.28 From 2.6.28, normal md device will be able to have partitions. These partitions will have a different major number. Sometimes mdadm tests the major number and so can get confused. Change these tests to test against get_mdp_major(). mdp does not use extended minor number and so this test will always be accurate. Also use /sys/dev links to map major/minor to devnum in sysfs. Signed-off-by: NeilBrown --- Detail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Detail.c') diff --git a/Detail.c b/Detail.c index 9ba8af1..3cee66f 100644 --- a/Detail.c +++ b/Detail.c @@ -169,7 +169,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) struct mdstat_ent *ms = mdstat_read(0, 0); struct mdstat_ent *e; int devnum = array.md_minor; - if (major(stb.st_rdev) != MD_MAJOR) + if (major(stb.st_rdev) == get_mdp_major()) devnum = -1 - devnum; for (e=ms; e; e=e->next) -- cgit