diff options
Diffstat (limited to 'c_src')
-rw-r--r-- | c_src/cmd_option.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/c_src/cmd_option.c b/c_src/cmd_option.c index eaf3429f..99e397b9 100644 --- a/c_src/cmd_option.c +++ b/c_src/cmd_option.c @@ -111,16 +111,16 @@ int cmd_set_option(int argc, char *argv[]) if (!bch2_opt_defined_by_id(&new_opts, i)) continue; - ret = bch2_opt_check_may_set(c, i, v); - if (ret < 0) { - fprintf(stderr, "error setting %s: %i\n", opt->attr.name, ret); - continue; - } - if (!(opt->flags & (OPT_FS|OPT_DEVICE))) fprintf(stderr, "Can't set option %s\n", opt->attr.name); if (opt->flags & OPT_FS) { + ret = bch2_opt_check_may_set(c, NULL, i, v); + if (ret < 0) { + fprintf(stderr, "error setting %s: %i\n", opt->attr.name, ret); + continue; + } + bch2_opt_set_sb(c, NULL, opt, v); } @@ -133,6 +133,12 @@ int cmd_set_option(int argc, char *argv[]) continue; } + ret = bch2_opt_check_may_set(c, ca, i, v); + if (ret < 0) { + fprintf(stderr, "error setting %s: %i\n", opt->attr.name, ret); + continue; + } + bch2_opt_set_sb(c, ca, opt, v); bch2_dev_put(ca); } |