Skip to content
/ linux Public

Commit 46fb7ee

Browse files
fdmananaSasha Levin
authored andcommitted
btrfs: qgroup: return correct error when deleting qgroup relation item
[ Upstream commit 51b1fcf ] 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: 73798c4 ("btrfs: qgroup: Try our best to delete qgroup relations") Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a51cff9 commit 46fb7ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/btrfs/qgroup.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,8 +1601,10 @@ static int __del_qgroup_relation(struct btrfs_trans_handle *trans, u64 src,
16011601
if (ret < 0 && ret != -ENOENT)
16021602
goto out;
16031603
ret2 = del_qgroup_relation_item(trans, dst, src);
1604-
if (ret2 < 0 && ret2 != -ENOENT)
1604+
if (ret2 < 0 && ret2 != -ENOENT) {
1605+
ret = ret2;
16051606
goto out;
1607+
}
16061608

16071609
/* At least one deletion succeeded, return 0 */
16081610
if (!ret || !ret2)

0 commit comments

Comments
 (0)