]> Gentwo Git Trees - linux/.git/commit
btrfs: send: do not allocate memory for xattr data when checking it exists
authorFilipe Manana <fdmanana@suse.com>
Wed, 19 Nov 2025 17:59:52 +0000 (17:59 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 25 Nov 2025 00:53:33 +0000 (01:53 +0100)
commit5c9cac55b7a2c203cc135560fce053beea173c0f
tree7d1f743d02c28d8dc812a034678f02ae24d6bb17
parent7c3acdb998dd723ac791cd4a47f13599d76a1f58
btrfs: send: do not allocate memory for xattr data when checking it exists

When checking if xattrs were deleted we don't care about their data, but
we are allocating memory for the data and copying it, which only wastes
time and can result in an unnecessary error in case the allocation fails.
So stop allocating memory and copying data by making find_xattr() and
__find_xattr() skip those steps if the given data buffer is NULL.

Reviewed-by: Boris Burkov <boris@bur.io>
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/send.c