summaryrefslogtreecommitdiff
path: root/fs/bcachefs/opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/opts.c')
-rw-r--r--fs/bcachefs/opts.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c
index 13a9a2fcd575..cbacd2f36799 100644
--- a/fs/bcachefs/opts.c
+++ b/fs/bcachefs/opts.c
@@ -299,15 +299,8 @@ int bch2_opt_check_may_set(struct bch_fs *c, int id, u64 v)
ret = bch2_check_set_has_compressed_data(c, v);
break;
case Opt_erasure_code:
- if (v &&
- !(c->sb.features & (1ULL << BCH_FEATURE_EC))) {
- mutex_lock(&c->sb_lock);
- c->disk_sb.sb->features[0] |=
- cpu_to_le64(1ULL << BCH_FEATURE_EC);
-
- bch2_write_super(c);
- mutex_unlock(&c->sb_lock);
- }
+ if (v)
+ bch2_check_set_feature(c, BCH_FEATURE_EC);
break;
}