From: NeilBrown Date: Tue, 15 Mar 2011 04:35:04 +0000 (+1100) Subject: Merge branch 'master' into devel-3.2 X-Git-Tag: mdadm-3.2.1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88b496c2697ed531ffecf2f8ced76f437297e5fe;p=thirdparty%2Fmdadm.git Merge branch 'master' into devel-3.2 Conflicts: Manage.c managemon.c super-ddf.c super-intel.c --- 88b496c2697ed531ffecf2f8ced76f437297e5fe diff --cc managemon.c index 15b6e692,8684e273..d6c57f78 --- a/managemon.c +++ b/managemon.c @@@ -441,31 -430,12 +441,36 @@@ static void manage_member(struct mdstat a->info.array.raid_disks = mdstat->raid_disks; // MORE + /* honor 'frozen' */ + if (sysfs_get_str(&a->info, NULL, "metadata_version", buf, sizeof(buf)) > 0) + frozen = buf[9] == '-'; + else + frozen = 1; /* can't read metadata_version assume the worst */ + + /* If sync_action is not 'idle' then don't try recovery now */ + if (!frozen + && sysfs_get_str(&a->info, NULL, "sync_action", buf, sizeof(buf)) > 0 + && strncmp(buf, "idle", 4) != 0) + frozen = 1; + + if (mdstat->level) { + int level = map_name(pers, mdstat->level); + if (a->info.array.level != level && level >= 0) { + struct active_array *newa = duplicate_aa(a); + if (newa) { + newa->info.array.level = level; + replace_array(a->container, a, newa); + a = newa; + } + } + } + - if (a->check_degraded && !frozen) { + /* We don't check the array while any update is pending, as it - * might container a change (such as a spare assignment) which ++ * might container a change (such as a spare assignment) which + * could affect our decisions. + */ - if (a->check_degraded && ++ if (a->check_degraded && !frozen && + update_queue == NULL && update_queue_pending == NULL) { struct metadata_update *updates = NULL; struct mdinfo *newdev = NULL; struct active_array *newa; diff --cc mdadm.8.in index d99bc05d,05ae34f6..4b70e205 --- a/mdadm.8.in +++ b/mdadm.8.in @@@ -2240,8 -2158,12 +2240,12 @@@ space to start being used. If the siz are synchronised. Note that when an array changes size, any filesystem that may be - stored in the array will not automatically grow to use the space. The - filesystem will need to be explicitly told to use the extra space. + stored in the array will not automatically grow for shrink to use or -vacate the space. The ++vacate the space. The + filesystem will need to be explicitly told to use the extra space + after growing, or to reduce its size + .B prior + to shrinking the array. Also the size of an array cannot be changed while it has an active bitmap. If an array has a bitmap, it must be removed before the size @@@ -2269,19 -2191,10 +2273,20 @@@ increase the number of devices in a RAI an interrupted "reshape". From 2.6.31, the Linux Kernel is able to increase or decrease the number of devices in a RAID5 or RAID6. +From 2.6.35, the Linux Kernel is able to convert a RAID0 in to a RAID4 +or RAID5. +.I mdadm +uses this functionality and the ability to add +devices to a RAID4 to allow devices to be added to a RAID0. When +requested to do this, +.I mdadm +will convert the RAID0 to a RAID4, add the necessary disks and make +the reshape happen, and then convert the RAID4 back to RAID0. + When decreasing the number of devices, the size of the array will also decrease. If there was data in the array, it could get destroyed and - this is not reversible. To help prevent accidents, + this is not reversible, so you should firstly shrink the filesystem on + the array to fit within the new size. To help prevent accidents, .I mdadm requires that the size of the array be decreased first with .BR "mdadm --grow --array-size" .