From: Kent Overstreet Date: Tue, 9 Aug 2022 17:47:03 +0000 (-0400) Subject: bcachefs: Fix missing error handling in bch2_subvolume_delete() X-Git-Tag: v6.7-rc1~201^2~849 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31301dd46975b2423fd38fc64bc58728d89dbcac;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c index b5b0f5e39f976..24244bc3d2fbf 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);