Skip to content

Commit

Permalink
fixup! cmd_set_option: Can now set device options
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Aug 7, 2024
1 parent 6958dd8 commit da1d557
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions c_src/cmd_option.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ int cmd_set_option(int argc, char *argv[])
exit(EXIT_FAILURE);
}

mutex_lock(&c->sb_lock);

for (i = 0; i < bch2_opts_nr; i++) {
const struct bch_option *opt = bch2_opt_table + i;

Expand All @@ -108,7 +106,7 @@ int cmd_set_option(int argc, char *argv[])
fprintf(stderr, "Can't set option %s\n", opt->attr.name);

if (opt->flags & OPT_FS) {
__bch2_opt_set_sb(c->disk_sb.sb, -1, opt, v);
bch2_opt_set_sb(c, NULL, opt, v);
}

if (opt->flags & OPT_DEVICE) {
Expand All @@ -119,14 +117,11 @@ int cmd_set_option(int argc, char *argv[])
continue;
}

__bch2_opt_set_sb(c->disk_sb.sb, dev_idx, opt, v);
bch2_opt_set_sb(c, c->devs[dev_idx], opt, v);
}
}
}

bch2_write_super(c);
mutex_unlock(&c->sb_lock);

bch2_fs_stop(c);
return ret;
} else {
Expand Down

0 comments on commit da1d557

Please sign in to comment.