]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/inode.c
Update bcachefs sources to 8c94740b1bf8 bcachefs: Add missing vaidation for jset_entr...
[bcachefs-tools-debian] / libbcachefs / inode.c
index b9d6dbf3a54b26bacc211b3d4779fddc68460af6..a2c96f7c193f96bec34e041bfa0abbff5cf7620f 100644 (file)
@@ -1157,10 +1157,6 @@ int bch2_delete_dead_inodes(struct bch_fs *c)
 again:
        need_another_pass = false;
 
-       ret = bch2_btree_write_buffer_flush_sync(trans);
-       if (ret)
-               goto err;
-
        /*
         * Weird transaction restart handling here because on successful delete,
         * bch2_inode_rm_snapshot() will return a nested transaction restart,
@@ -1191,8 +1187,12 @@ again:
        }
        bch2_trans_iter_exit(trans, &iter);
 
-       if (!ret && need_another_pass)
+       if (!ret && need_another_pass) {
+               ret = bch2_btree_write_buffer_flush_sync(trans);
+               if (ret)
+                       goto err;
                goto again;
+       }
 err:
        bch2_trans_put(trans);