bcachefs: Fix missing error handling in bch2_subvolume_delete()
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 9 Aug 2022 17:47:03 +0000 (13:47 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:37 +0000 (17:09 -0400)
This fixes an assertion when the transaction has been unexpectedly
restarted.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/subvolume.c

index b5b0f5e39f9761b4318836292d688693a59bf2ee..24244bc3d2fbff6703dcf5b4e27d513ebb7082dc 100644 (file)
@@ -877,6 +877,8 @@ int bch2_subvolume_delete(struct btree_trans *trans, u32 subvolid)
                goto err;
 
        ret = bch2_snapshot_node_set_deleted(trans, snapid);
+       if (ret)
+               goto err;
 
        h = bch2_trans_kmalloc(trans, sizeof(*h));
        ret = PTR_ERR_OR_ZERO(h);