diff mbox

Q: md-RAID1 creation with I/O error (attempt to access beyond end of device)

Message ID 20101130110725.5f2d2407@notabene.brown (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

NeilBrown Nov. 30, 2010, 12:07 a.m. UTC
None
diff mbox

Patch

--- mdadm-2.6.orig/super0.c
+++ mdadm-2.6/super0.c
@@ -833,7 +833,7 @@  static int add_internal_bitmap0(struct s
 	 * size is in sectors,  chunk is in bytes !!!
 	 */
 	unsigned long long bits;
-	unsigned long long max_bits = 60*1024*8;
+	unsigned long long max_bits = (60*1024 - sizeof(bitmap_super_t))*8;
 	unsigned long long min_chunk;
 	int chunk = *chunkp;
 	mdp_super_t *sb = sbv;

--- mdadm-2.6.orig/super0.c
+++ mdadm-2.6/super0.c
@@ -833,7 +833,7 @@  static int add_internal_bitmap0(struct s
 	 * size is in sectors,  chunk is in bytes !!!
 	 */
 	unsigned long long bits;
-	unsigned long long max_bits = 60*1024*8;
+	unsigned long long max_bits = (60*1024 - sizeof(bitmap_super_t))*8;
 	unsigned long long min_chunk;
 	int chunk = *chunkp;
 	mdp_super_t *sb = sbv;