Fix problem with add a device to a 1.x array created with older mdadm.

When adding new disk to an array, don't reserve so much bitmap
space that the disk cannot store the required data. (Needed when
1.x array was created with older mdadm).
This commit is contained in:
Neil Brown 2007-08-20 14:14:25 +10:00
parent 85375d6de1
commit 005debfc11
6 changed files with 7 additions and 0 deletions

0
ANNOUNCE-2.6.3 Normal file
View File

View File

@ -1,5 +1,8 @@
Changes Prior to this release
- allow --write-behind to be set for --grow.
- When adding new disk to an array, don't reserve so much bitmap
space that the disk cannot store the required data. (Needed when
1.x array was created with older mdadm).
Changes Prior to 2.6.2 release
- --fail detached and --remove faulty can be used to fail and

0
crc32.c Normal file
View File

0
crc32.h Normal file
View File

0
super-ddf.c Normal file
View File

View File

@ -917,12 +917,16 @@ static int write_init_super1(struct supertype *st, void *sbv,
break;
case 1:
sb->super_offset = __cpu_to_le64(0);
if (4*2 + bm_space + __le64_to_cpu(sb->size) > dsize)
bm_space = dsize - __le64_to_cpu(sb->size) - 4*2;
sb->data_offset = __cpu_to_le64(bm_space + 4*2);
sb->data_size = __cpu_to_le64(dsize - bm_space - 4*2);
break;
case 2:
sb_offset = 4*2;
sb->super_offset = __cpu_to_le64(4*2);
if (4*2 + 4*2 + bm_space + __le64_to_cpu(sb->size) > dsize)
bm_space = dsize - __le64_to_cpu(sb->size) - 4*2 - 4*2;
sb->data_offset = __cpu_to_le64(4*2 + 4*2 + bm_space);
sb->data_size = __cpu_to_le64(dsize - 4*2 - 4*2 - bm_space );
break;