From: Filipe Manana Date: Tue, 20 Jan 2026 19:35:23 +0000 (+0000) Subject: btrfs: qgroup: return correct error when deleting qgroup relation item X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51b1fcf71c88c3c89e7dcf07869c5de837b1f428;p=thirdparty%2Fkernel%2Flinux.git btrfs: qgroup: return correct error when deleting qgroup relation item If we fail to delete the second qgroup relation item, we end up returning success or -ENOENT in case the first item does not exist, instead of returning the error from the second item deletion. Fixes: 73798c465b66 ("btrfs: qgroup: Try our best to delete qgroup relations") Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 14d393a5853d4..c03bb96d3a348 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -1640,8 +1640,10 @@ delete_item: if (ret < 0 && ret != -ENOENT) goto out; ret2 = del_qgroup_relation_item(trans, dst, src); - if (ret2 < 0 && ret2 != -ENOENT) + if (ret2 < 0 && ret2 != -ENOENT) { + ret = ret2; goto out; + } /* At least one deletion succeeded, return 0 */ if (!ret || !ret2)