bcachefs: Fix ref in trans_mark_dev_sbs() error path
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 19 May 2024 21:07:32 +0000 (17:07 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 20 May 2024 09:37:26 +0000 (05:37 -0400)
Reported-by: syzbot+5c7f715a7107a608a544@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/buckets.c

index 02bb02b70981947bc81719147003afe00e71d000..b469586517a86dbbf60110838208d3633f55cbe6 100644 (file)
@@ -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;
                }
        }