Commit 51b1fcf7 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

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: 73798c46 ("btrfs: qgroup: Try our best to delete qgroup relations")
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8ad2f2ed
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1640,8 +1640,10 @@ static int __del_qgroup_relation(struct btrfs_trans_handle *trans, u64 src,
	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)