config: new option to suppress adding bad block lists.
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>
This commit is contained in:
parent
968d2a336e
commit
e2efe9e7bc
5
config.c
5
config.c
|
@ -187,6 +187,7 @@ struct createinfo createinfo = {
|
||||||
.autof = 2, /* by default, create devices with standard names */
|
.autof = 2, /* by default, create devices with standard names */
|
||||||
.symlinks = 1,
|
.symlinks = 1,
|
||||||
.names = 0, /* By default, stick with numbered md devices. */
|
.names = 0, /* By default, stick with numbered md devices. */
|
||||||
|
.bblist = 1, /* Use a bad block list by default */
|
||||||
#ifdef DEBIAN
|
#ifdef DEBIAN
|
||||||
.gid = 6, /* disk */
|
.gid = 6, /* disk */
|
||||||
.mode = 0660,
|
.mode = 0660,
|
||||||
|
@ -306,6 +307,10 @@ static void createline(char *line)
|
||||||
createinfo.names = 1;
|
createinfo.names = 1;
|
||||||
else if (strncasecmp(w, "names=no", 11) == 0)
|
else if (strncasecmp(w, "names=no", 11) == 0)
|
||||||
createinfo.names = 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 {
|
else {
|
||||||
pr_err("unrecognised word on CREATE line: %s\n",
|
pr_err("unrecognised word on CREATE line: %s\n",
|
||||||
w);
|
w);
|
||||||
|
|
14
mdadm.conf.5
14
mdadm.conf.5
|
@ -293,8 +293,8 @@ line and it should be give only one program.
|
||||||
.B CREATE
|
.B CREATE
|
||||||
The
|
The
|
||||||
.B create
|
.B create
|
||||||
line gives default values to be used when creating arrays and device entries for
|
line gives default values to be used when creating arrays, new members
|
||||||
arrays.
|
of arrays, and device entries for arrays.
|
||||||
These include:
|
These include:
|
||||||
|
|
||||||
.RS 4
|
.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
|
device names will not be used even if the default changes in a future
|
||||||
release of
|
release of
|
||||||
.IR mdadm .
|
.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
|
.RE
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
|
1
mdadm.h
1
mdadm.h
|
@ -258,6 +258,7 @@ struct createinfo {
|
||||||
int mode;
|
int mode;
|
||||||
int symlinks;
|
int symlinks;
|
||||||
int names;
|
int names;
|
||||||
|
int bblist;
|
||||||
struct supertype *supertype;
|
struct supertype *supertype;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
4
super1.c
4
super1.c
|
@ -1688,6 +1688,10 @@ static int write_init_super1(struct supertype *st)
|
||||||
rv = -EINVAL;
|
rv = -EINVAL;
|
||||||
goto out;
|
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);
|
sb->sb_csum = calc_sb_1_csum(sb);
|
||||||
rv = store_super1(st, di->fd);
|
rv = store_super1(st, di->fd);
|
||||||
|
|
Loading…
Reference in New Issue