]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
config: new option to suppress adding bad block lists.
authorNeilBrown <neilb@suse.de>
Thu, 7 Aug 2014 02:23:45 +0000 (12:23 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 7 Aug 2014 02:23:45 +0000 (12:23 +1000)
   CREATE bbl=no

in mdadm.conf will cause any devices added to an array
to not have a bad block list.  By default they do for 1.x
metadata.

This is useful if you are suspicious of the bad-block-list
implementation.

Reported-by: Ethan Wilson <ethan.wilson@shiftmail.org>
Signed-off-by: NeilBrown <neilb@suse.de>
config.c
mdadm.conf.5
mdadm.h
super1.c

index a35807ccae3510e3620aa5a6426d4ef4ee2804f4..909f83f4a4fb840cf5c77ec3fd796d83e08a67f6 100644 (file)
--- a/config.c
+++ b/config.c
@@ -187,6 +187,7 @@ struct createinfo createinfo = {
        .autof = 2, /* by default, create devices with standard names */
        .symlinks = 1,
        .names = 0, /* By default, stick with numbered md devices. */
+       .bblist = 1, /* Use a bad block list by default */
 #ifdef DEBIAN
        .gid = 6, /* disk */
        .mode = 0660,
@@ -306,6 +307,10 @@ static void createline(char *line)
                        createinfo.names = 1;
                else if  (strncasecmp(w, "names=no", 11) == 0)
                        createinfo.names = 0;
+               else if  (strncasecmp(w, "bbl=no", 11) == 0)
+                       createinfo.bblist = 0;
+               else if  (strncasecmp(w, "bbl=yes", 11) == 0)
+                       createinfo.bblist = 1;
                else {
                        pr_err("unrecognised word on CREATE line: %s\n",
                                w);
index 61267b6186e242fa5fdba0a373ddbfa2d16aa964..18512cb0ec7edfe32d0af3ae7f4700c4b8c9cf2b 100644 (file)
@@ -293,8 +293,8 @@ line and it should be give only one program.
 .B CREATE
 The
 .B create
-line gives default values to be used when creating arrays and device entries for
-arrays.
+line gives default values to be used when creating arrays, new members
+of arrays, and device entries for arrays.
 These include:
 
 .RS 4
@@ -365,6 +365,16 @@ is given, then non-numeric
 device names will not be used even if the default changes in a future
 release of
 .IR mdadm .
+
+.TP
+.B bbl=no
+By default,
+.I mdadm
+will reserve space for a bad block list (bbl) on all devices
+included in or added to any array that supports them.  Setting
+.B bbl=no
+will prevent this, so newly added devices will not have a bad
+block log.
 .RE
 
 .TP
diff --git a/mdadm.h b/mdadm.h
index 02a9288d86b8b1d334ad1aa0560afe7f64d5baba..dc3c107dbed534a14ed30b5255fc19f03e8133ad 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -258,6 +258,7 @@ struct createinfo {
        int     mode;
        int     symlinks;
        int     names;
+       int     bblist;
        struct supertype *supertype;
 };
 
index 7fba9be0a252a868a579f732fc4bd8a39d503797..9834594c3e44d1553d564659bc81c5209cb807a6 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -1688,6 +1688,10 @@ static int write_init_super1(struct supertype *st)
                        rv = -EINVAL;
                        goto out;
                }
+               if (conf_get_create_info()->bblist == 0) {
+                       sb->bblog_size = 0;
+                       sb->bblog_offset = 0;
+               }
 
                sb->sb_csum = calc_sb_1_csum(sb);
                rv = store_super1(st, di->fd);