]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Improve comments for block_monitor.
authorNeilBrown <neilb@suse.de>
Sun, 28 Nov 2010 23:32:15 +0000 (10:32 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 28 Nov 2010 23:32:15 +0000 (10:32 +1100)
Also not that the leading '-' on the metadata names now
simply means that mdmon must not reconfiure the array.

Signed-off-by: NeilBrown <neilb@suse.de>
mdadm.h
msg.c

diff --git a/mdadm.h b/mdadm.h
index 48a202d6d97877451d63e827c586451b7e6964d7..d754730af6373fc28e5664a4aa6b676bc8dd2504 100644 (file)
--- 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 bfeadb34f34d46f8d3d0ac037edeb345a26edcc9..5ddf6e36fa3fc748f6e904a2ac4f9bb93c8d76fd 100644 (file)
--- 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)
 {