summaryrefslogtreecommitdiff
path: root/fs/bcachefs/subvolume.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-08-09 20:47:03 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:37 +0300
commit31301dd46975b2423fd38fc64bc58728d89dbcac (patch)
tree3efef4557d258cc861dd690077c67a9d7b214ca3 /fs/bcachefs/subvolume.c
parent15f11c1aa8a98f3b6805d0b2a300a87ef0205d34 (diff)
downloadlinux-31301dd46975b2423fd38fc64bc58728d89dbcac.tar.xz
bcachefs: Fix missing error handling in bch2_subvolume_delete()
This fixes an assertion when the transaction has been unexpectedly restarted. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/subvolume.c')
-rw-r--r--fs/bcachefs/subvolume.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c
index b5b0f5e39f97..24244bc3d2fb 100644
--- a/fs/bcachefs/subvolume.c
+++ b/fs/bcachefs/subvolume.c
@@ -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);