diff --git a/mdadm.c b/mdadm.c index feec3b7..51e16f3 100644 --- a/mdadm.c +++ b/mdadm.c @@ -757,6 +757,8 @@ int main(int argc, char *argv[]) continue; if (strcmp(c.update, "no-bbl") == 0) continue; + if (strcmp(c.update, "force-no-bbl") == 0) + continue; if (strcmp(c.update, "metadata") == 0) continue; if (strcmp(c.update, "revert-reshape") == 0) @@ -790,7 +792,7 @@ int main(int argc, char *argv[]) " 'sparc2.2', 'super-minor', 'uuid', 'name', 'nodes', 'resync',\n" " 'summaries', 'homehost', 'home-cluster', 'byteorder', 'devicesize',\n" " 'no-bitmap', 'metadata', 'revert-reshape'\n" - " 'bbl', 'no-bbl'\n" + " 'bbl', 'no-bbl', 'force-no-bbl'\n" ); exit(outf == stdout ? 0 : 2); @@ -808,8 +810,9 @@ int main(int argc, char *argv[]) c.update = optarg; if (strcmp(c.update, "devicesize") != 0 && strcmp(c.update, "bbl") != 0 && + strcmp(c.update, "force-no-bbl") != 0 && strcmp(c.update, "no-bbl") != 0) { - pr_err("only 'devicesize', 'bbl' and 'no-bbl' can be updated with --re-add\n"); + pr_err("only 'devicesize', 'bbl', 'no-bbl', and 'force-no-bbl' can be updated with --re-add\n"); exit(2); } continue; diff --git a/mdadm.h b/mdadm.h index 99802c3..dd02be7 100755 --- a/mdadm.h +++ b/mdadm.h @@ -820,7 +820,8 @@ extern struct superswitch { * readwrite - clear the WriteMostly1 bit in the superblock devflags * no-bitmap - clear any record that a bitmap is present. * bbl - add a bad-block-log if possible - * no-bbl - remove and bad-block-log is it is empty. + * no-bbl - remove any bad-block-log is it is empty. + * force-no-bbl - remove any bad-block-log even if empty. * revert-reshape - If a reshape is in progress, modify metadata so * it will resume going in the opposite direction. */ diff --git a/super1.c b/super1.c index 2df590e..10e0065 100644 --- a/super1.c +++ b/super1.c @@ -1282,6 +1282,11 @@ static int update_super1(struct supertype *st, struct mdinfo *info, sb->bblog_shift = 0; sb->bblog_offset = 0; } + } else if (strcmp(update, "force-no-bbl") == 0) { + sb->feature_map &= ~ __cpu_to_le32(MD_FEATURE_BAD_BLOCKS); + sb->bblog_size = 0; + sb->bblog_shift = 0; + sb->bblog_offset = 0; } else if (strcmp(update, "name") == 0) { if (info->name[0] == 0) sprintf(info->name, "%d", info->array.md_minor);