aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <[email protected]>2024-08-20 19:31:20 -0400
committerKent Overstreet <[email protected]>2024-08-22 02:07:23 -0400
commit6575b8c9877c3dd1f7db1d0d61bd250a0bf18b6d (patch)
tree49dbf1de07cd5d34c4f7514ecf28a1cfdbdcd838
parent5dbfc4ef72f15508882aff58c307b8425cf037a8 (diff)
bcachefs: Fix locking in bch2_ioc_setlabel()
Fixes: 7a254053a590 ("bcachefs: support FS_IOC_SETFSLABEL") Reported-by: [email protected] Signed-off-by: Kent Overstreet <[email protected]>
-rw-r--r--fs/bcachefs/fs-ioctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c
index aea8132d2c40..99c7fe987c74 100644
--- a/fs/bcachefs/fs-ioctl.c
+++ b/fs/bcachefs/fs-ioctl.c
@@ -328,9 +328,8 @@ static int bch2_ioc_setlabel(struct bch_fs *c,
mutex_lock(&c->sb_lock);
strscpy(c->disk_sb.sb->label, label, BCH_SB_LABEL_SIZE);
- mutex_unlock(&c->sb_lock);
-
ret = bch2_write_super(c);
+ mutex_unlock(&c->sb_lock);
mnt_drop_write_file(file);
return ret;