aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorDave Chen <[email protected]>2025-04-15 06:33:42 +0000
committerDavid Sterba <[email protected]>2025-04-23 06:41:09 +0000
commitbe3f1938d3e6ea8186f0de3dd95245dda4f22c1e (patch)
tree55ec3eb78cdca91d0dd055117b32ac956f74f5af /fs/btrfs/compression.c
parentbtrfs: zoned: skip reporting zone for new block group (diff)
downloadkernel-be3f1938d3e6ea8186f0de3dd95245dda4f22c1e.tar.gz
kernel-be3f1938d3e6ea8186f0de3dd95245dda4f22c1e.zip
btrfs: fix COW handling in run_delalloc_nocow()
In run_delalloc_nocow(), when the found btrfs_key's offset > cur_offset, it indicates a gap between the current processing region and the next file extent. The original code would directly jump to the "must_cow" label, which increments the slot and forces a fallback to COW. This behavior might skip an extent item and result in an overestimated COW fallback range. This patch modifies the logic so that when a gap is detected: - If no COW range is already being recorded (cow_start is unset), cow_start is set to cur_offset. - cur_offset is then advanced to the beginning of the next extent. - Instead of jumping to "must_cow", control flows directly to "next_slot" so that the same extent item can be reexamined properly. The change ensures that we accurately account for the extent gap and avoid accidentally extending the range that needs to fallback to COW. CC: [email protected] # 6.6+ Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Dave Chen <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/compression.c')
0 files changed, 0 insertions, 0 deletions