From: NeilBrown Date: Sun, 28 Nov 2010 23:32:15 +0000 (+1100) Subject: Improve comments for block_monitor. X-Git-Tag: mdadm-3.2~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=746a6567d37e7dac1b9174137ed50143de203e15;p=thirdparty%2Fmdadm.git Improve comments for block_monitor. Also not that the leading '-' on the metadata names now simply means that mdmon must not reconfiure the array. Signed-off-by: NeilBrown --- diff --git a/mdadm.h b/mdadm.h index 48a202d6..d754730a 100644 --- a/mdadm.h +++ b/mdadm.h @@ -1136,7 +1136,9 @@ static inline int is_subarray(char *vers) /* The version string for a 'subarray' (an array in a container) * is * /containername/componentname for normal read-write arrays - * -containername/componentname for read-only arrays. + * -containername/componentname for arrays which mdmon must not + * reconfigure. They might be read-only + * or might be undergoing reshape etc. * containername is e.g. md0, md_d1 * componentname is dependant on the metadata. e.g. '1' 'S1' ... */ diff --git a/msg.c b/msg.c index bfeadb34..5ddf6e36 100644 --- a/msg.c +++ b/msg.c @@ -261,9 +261,18 @@ static int unblock_subarray(struct mdinfo *sra, const int unfreeze) * @freeze - flag to additionally freeze sync_action * * This is used by the reshape code to freeze the container, and the - * auto-rebuild implementation to atomically move spares. For reshape - * we need to freeze sync_action in the auto-rebuild we only need to - * block new spare assignment, existing rebuilds can continue + * auto-rebuild implementation to atomically move spares. + * In both cases we need to stop mdmon from assigning spares to replace + * failed devices as we might have other plans for the spare. + * For the reshape case we also need to 'freeze' sync_action so that + * no recovery happens until we have fully prepared for the reshape. + * + * We tell mdmon that the array is frozen by marking the 'metadata' name + * with a leading '-'. The previously told mdmon "Don't make this array + * read/write, leave it readonly". Now it means a more general "Don't + * reconfigure this array at all". + * As older versions of mdmon (which might run from initrd) don't understand + * this, we first check that the running mdmon is new enough. */ int block_monitor(char *container, const int freeze) {