From: Kent Overstreet Date: Tue, 20 Aug 2024 23:31:20 +0000 (-0400) Subject: bcachefs: Fix locking in bch2_ioc_setlabel() X-Git-Tag: v6.11-rc5~1^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6575b8c9877c3dd1f7db1d0d61bd250a0bf18b6d;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Fix locking in bch2_ioc_setlabel() Fixes: 7a254053a590 ("bcachefs: support FS_IOC_SETFSLABEL") Reported-by: syzbot+7e9efdfec27fbde0141d@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/fs-ioctl.c b/fs/bcachefs/fs-ioctl.c index aea8132d2c40e..99c7fe987c74f 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;