[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1223140874-7067-1-git-send-email-crquan@gmail.com>
Date: Sun, 5 Oct 2008 01:21:14 +0800
From: crquan@...il.com
To: Neil Brown <neilb@...e.de>, linux-raid@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Subject: [MD] need another print_sb for mdp_superblock_1
The current print_sb function is only for superblock 0.90.xx, not for
superblock 1.00.00 above, otherwise it would drop silly messages like
md: **********************************
md: * <COMPLETE RAID STATE PRINTOUT> *
md: **********************************
md2: <ram2><ram3><ram1><ram0>
md: rdev ram2, SZ:00065472 F:0 S:1 DN:4
md: rdev superblock:
md: SB: (V:1.0.0) ID:<35550a8f.00000000.00000000.00000000> CT:4f45a9ef
md: L978400564 S1684889970 ND:762016617 RD:1684627826 md13613 LO:65536 CS:-2
md: UT:00000010 ST:0 AD:131056 WD:0 FD:0 SD:0 CSUM:00000000 E:00000000
D 0: DISK<N:-1,(-1,-1),R:-1,S:-1>
D 1: DISK<N:-1,(-1,-1),R:-1,S:-1>
D 2: DISK<N:-1,(-1,-1),R:-1,S:-1>
D 3: DISK<N:-1,(-1,-1),R:-1,S:-1>
md: THIS: DISK<N:0,(0,0),R:0,S:0>
So we need another print_mdp_superblock_1 function, either directly used in
print_rdev or or we can add an function pointer to struct super_type.
Denis ChengRq
---
This little patch is just an implementation example, we can revamp print_rdev,
but I'm more intended for another pointer in struct super_type.
diff --git a/drivers/md/md.c b/drivers/md/md.c
index deeac4b..d7f1b22 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1634,7 +1634,7 @@ static void print_sb(mdp_super_t *sb)
}
-static void print_rdev(mdk_rdev_t *rdev)
+static void print_rdev(mdk_rdev_t *rdev, int major_version)
{
char b[BDEVNAME_SIZE];
printk(KERN_INFO "md: rdev %s, SZ:%08llu F:%d S:%d DN:%u\n",
@@ -1643,7 +1643,9 @@ static void print_rdev(mdk_rdev_t *rdev)
rdev->desc_nr);
if (rdev->sb_loaded) {
printk(KERN_INFO "md: rdev superblock:\n");
- print_sb((mdp_super_t*)page_address(rdev->sb_page));
+ if (major_version == 0)
+ print_sb((mdp_super_t*)page_address(rdev->sb_page));
+ /* if major_version 1: print mdp_superblock_1 */
} else
printk(KERN_INFO "md: no rdev superblock!\n");
}
@@ -1670,7 +1672,7 @@ static void md_print_devices(void)
printk("\n");
rdev_for_each(rdev, tmp2, mddev)
- print_rdev(rdev);
+ print_rdev(rdev, mddev->major_version);
}
printk("md: **********************************\n");
printk("\n");
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists