From: Kent Overstreet Date: Sun, 19 May 2024 21:07:32 +0000 (-0400) Subject: bcachefs: Fix ref in trans_mark_dev_sbs() error path X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9667214b30ef19c1cbead7893257619bca4d0d4d;p=linux.git bcachefs: Fix ref in trans_mark_dev_sbs() error path Reported-by: syzbot+5c7f715a7107a608a544@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 02bb02b709819..b469586517a86 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1465,7 +1465,7 @@ int bch2_trans_mark_dev_sbs_flags(struct bch_fs *c, for_each_online_member(c, ca) { int ret = bch2_trans_mark_dev_sb(c, ca, flags); if (ret) { - bch2_dev_put(ca); + percpu_ref_put(&ca->io_ref); return ret; } }