]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: fix the entry condition of exact EOF block allocation optimization
authorJinliang Zheng <alexjlzheng@gmail.com>
Mon, 24 Feb 2025 18:21:56 +0000 (10:21 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:00 +0000 (09:16 -0800)
commitc89b1f70b43dc7d1dd7147d5147170db651131a4
tree5937c6377ed7124fde1e91e3f61e6aae952a72b5
parent56ca835f32b6104f530215e542f388205cf357c8
xfs: fix the entry condition of exact EOF block allocation optimization

Source kernel commit: 915175b49f65d9edeb81659e82cbb27b621dbc17

When we call create(), lseek() and write() sequentially, offset != 0
cannot be used as a judgment condition for whether the file already
has extents.

Furthermore, when xfs_bmap_adjacent() has not given a better blkno,
it is not necessary to use exact EOF block allocation.

Suggested-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_bmap.c