]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: fix reservation leak in some error paths when inserting inline extent
authorFilipe Manana <fdmanana@suse.com>
Fri, 12 Dec 2025 17:18:25 +0000 (17:18 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 16 Dec 2025 21:53:15 +0000 (22:53 +0100)
commitc1c050f92d8f6aac4e17f7f2230160794fceef0c
tree86964e76945381808f45ef0bd6f451eb166059fc
parentf8da41de0bff9eb1d774a7253da0c9f637c4470a
btrfs: fix reservation leak in some error paths when inserting inline extent

If we fail to allocate a path or join a transaction, we return from
__cow_file_range_inline() without freeing the reserved qgroup data,
resulting in a leak. Fix this by ensuring we call btrfs_qgroup_free_data()
in such cases.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c