From: NeilBrown Date: Thu, 9 Dec 2010 00:16:42 +0000 (+1100) Subject: Merge branch 'master' into devel-3.2 X-Git-Tag: mdadm-3.2~189 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=commitdiff_plain;h=f80c8614b0014fde1220591fcc4a1365c9cde0c4 Merge branch 'master' into devel-3.2 Conflicts: mdadm.8.in Same conceptual change was written with different words in each version. Signed-off-by: NeilBrown --- f80c8614b0014fde1220591fcc4a1365c9cde0c4 diff --cc mdadm.8.in index 8a75e256,00c32dc2..fed5b628 --- a/mdadm.8.in +++ b/mdadm.8.in @@@ -676,12 -664,27 +680,12 @@@ facts the operator knows .BR \-\-backup\-file= This is needed when .B \-\-grow - is used to increase the number of - raid-devices in a RAID5 if there are no spare devices available. - See the GROW MODE section below on RAID\-DEVICES CHANGES. The file - should be stored on a separate device, not on the RAID array being - reshaped. + is used to increase the number of raid-devices in a RAID5 or RAID6 if + there are no spare devices available, or to shrink, change RAID level + or layout. See the GROW MODE section below on RAID\-DEVICES CHANGES. + The file must be stored on a separate device, not on the RAID array + being reshaped. -.TP -.BR \-\-array-size= ", " \-Z -Set the size of the array which is seen by users of the device such as -filesystems. This can be less that the real size, but never greater. -The size set this way does not persist across restarts of the array. - -This is most useful when reducing the number of devices in a RAID5 or -RAID6. Such arrays require the array-size to be reduced before a -reshape can be performed that reduces the real size. - -A value of -.B max -restores the apparent size of the array to be whatever the real -amount of available space is. - .TP .BR \-N ", " \-\-name= Set a @@@ -889,19 -893,9 +893,20 @@@ chunk size) and the system crashed duri .B \-\-backup\-file must be presented to .B \-\-assemble - to allow possibly corrupted data to be restored. + to allow possibly corrupted data to be restored, and the reshape + to be completed. +.TP +.BR \-\-invalid\-backup +If the file needed for the above option is not available for any +reason an empty file can be given together with this option to +indicate that the backup file is invalid. In this case the data that +was being rearranged at the time of the crash could be irrecoverably +lost, but the rest of the array may still be recoverable. This option +should only be used as a last resort if there is no way to recover the +backup file. + + .TP .BR \-U ", " \-\-update= Update the superblock on each device while assembling the array. The diff --cc super1.c index ee940333,0eb03230..f879e669 --- a/super1.c +++ b/super1.c @@@ -691,14 -673,15 +691,14 @@@ static int update_super1(struct superty int d = info->disk.number; int want; if (info->disk.state == 6) - want = __cpu_to_le32(info->disk.raid_disk); + want = info->disk.raid_disk; else want = 0xFFFF; - if (sb->dev_roles[d] != want) { - sb->dev_roles[d] = want; + if (sb->dev_roles[d] != __cpu_to_le16(want)) { + sb->dev_roles[d] = __cpu_to_le16(want); rv = 1; } - } - if (strcmp(update, "linear-grow-new") == 0) { + } else if (strcmp(update, "linear-grow-new") == 0) { unsigned int i; int rfd, fd; unsigned int max = __le32_to_cpu(sb->max_dev);