summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-04-15 21:01:35 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-04-15 21:02:26 -0400
commitd779e1373206ee016102bada7561c87dc9b9c412 (patch)
tree1113dd7ea55c53fff7ac4deb618afa35c0197e30
parent73c423a3d9792df2215fc26c7f8b8b103e0b35c2 (diff)
fixup! bcachefs: Check for rw before setting opts via sysfs
-rw-r--r--fs/bcachefs/sysfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c
index 33a10b419987..00b9a19aee50 100644
--- a/fs/bcachefs/sysfs.c
+++ b/fs/bcachefs/sysfs.c
@@ -617,7 +617,7 @@ STORE(bch2_fs_opts_dir)
{
struct bch_fs *c = container_of(kobj, struct bch_fs, opts_dir);
const struct bch_option *opt = container_of(attr, struct bch_option, attr);
- int ret = size, id = opt - bch2_opt_table;
+ int ret, id = opt - bch2_opt_table;
char *tmp;
u64 v;
@@ -652,6 +652,8 @@ STORE(bch2_fs_opts_dir)
bch2_rebalance_add_work(c, S64_MAX);
rebalance_wakeup(c);
}
+
+ ret = size;
err:
percpu_ref_put(&c->writes);
return ret;