]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
bcachefs: delete_dead_snapshots() doesn't need to go RW
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 17 Jun 2024 13:51:01 +0000 (09:51 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 19 Jun 2024 22:27:24 +0000 (18:27 -0400)
We've been moving away from going RW lazily; if we want to go RW we do
that in set_may_go_rw(), and if we didn't go RW we don't need to delete
dead snapshots.

Reported-by: syzbot+4366624c0b5aac4906cf@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/snapshot.c

index 51918acfd72681cc2249a0b123f1e020ecf6e3d5..961b5f56358c8ae001ae9e8ac8b0390c9ad71824 100644 (file)
@@ -1565,13 +1565,6 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
        if (!test_and_clear_bit(BCH_FS_need_delete_dead_snapshots, &c->flags))
                return 0;
 
-       if (!test_bit(BCH_FS_started, &c->flags)) {
-               ret = bch2_fs_read_write_early(c);
-               bch_err_msg(c, ret, "deleting dead snapshots: error going rw");
-               if (ret)
-                       return ret;
-       }
-
        trans = bch2_trans_get(c);
 
        /*