diff options
| author | Filipe Manana <fdmanana@suse.com> | 2026-09-25 17:12:45 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-05 16:05:44 +0200 |
| commit | 41c8899d59898f6fa51ceebd2b6e55257191a8ee (patch) | |
| tree | 43eaff219fbf87fd7bad766d5090eac3d32d5e8d /scripts/Makefile.headersinst | |
| parent | 858bee1c77857aabcc2327cd32dd8266332de332 (diff) | |
btrfs: fix lost error return value in btrfs_listxattr()
If the input buffer does not have enough space to store the current xattr,
we set 'iter_ret' to -ERANGE and then do "break", but that only exits the
while loop over the xattrs in the current btrfs_dir_item, and then we
continue the btrfs_for_each_slot() iteration, which overwrites the value
of 'iter_ret' causing us to lose the error return value and proceed as if
the buffer has enough space.
Fix this by returning -ERANGE directly (the path is automatically freed)
instead of breaking from the while loop.
Fixes: 184b3d190087 ("btrfs: use btrfs_for_each_slot in btrfs_listxattr")
Assisted-by: LLM (found the bug)
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/Makefile.headersinst')
0 files changed, 0 insertions, 0 deletions
