linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Version 1 super block
@ 2005-01-16  2:50 Mike Tran
  2005-01-21 15:59 ` Mike Tran
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Tran @ 2005-01-16  2:50 UTC (permalink / raw)
  To: Neil Brown; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

Hello Neil,

I found 2 problems in the kernel MD driver:
1) if disk index 0 is used, counting of max_dev is wrong
2) missing checksum calculation

Please consider the attached patch for 2.6.10 kernel.
--
Thanks,
Mike T.


[-- Attachment #2: md-2.6.10.patch --]
[-- Type: text/plain, Size: 599 bytes --]

--- a/linux-2.6.10/drivers/md/md.c	2005-01-15 07:52:14.000000000 -0600
+++ b/linux-2.6.10/drivers/md/md.c	2005-01-15 07:52:14.000000000 -0600
@@ -939,9 +939,13 @@
 		sb->resync_offset = cpu_to_le64(0);
 
 	max_dev = 0;
-	ITERATE_RDEV(mddev,rdev2,tmp)
+	i = 0;
+	ITERATE_RDEV(mddev,rdev2,tmp) {
+		i++;
 		if (rdev2->desc_nr > max_dev)
 			max_dev = rdev2->desc_nr;
+	}
+	max_dev = max(max_dev, i);
 	
 	sb->max_dev = cpu_to_le32(max_dev);
 	for (i=0; i<max_dev;i++)
@@ -958,6 +962,7 @@
 	}
 
 	sb->recovery_offset = cpu_to_le64(0); /* not supported yet */
+	sb->sb_csum = calc_sb_1_csum(sb);
 }
 
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-24 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-16  2:50 [PATCH] Version 1 super block Mike Tran
2005-01-21 15:59 ` Mike Tran
2005-01-24  1:38   ` Neil Brown
2005-01-24 19:16     ` Mike Tran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).