aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_exchrange.c
diff options
context:
space:
mode:
authorDarrick J. Wong <[email protected]>2024-12-02 18:57:30 +0000
committerDarrick J. Wong <[email protected]>2024-12-13 01:45:09 +0000
commitaf9f02457f461b23307fe826a37be61ba6e32c92 (patch)
tree2ab90967f690d76ad7bc26a7bcc899fd47a42ddb /fs/xfs/xfs_exchrange.c
parentxfs: mark metadir repair tempfiles with IRECOVERY (diff)
downloadkernel-af9f02457f461b23307fe826a37be61ba6e32c92.tar.gz
kernel-af9f02457f461b23307fe826a37be61ba6e32c92.zip
xfs: fix null bno_hint handling in xfs_rtallocate_rtg
xfs_bmap_rtalloc initializes the bno_hint variable to NULLRTBLOCK (aka NULLFSBLOCK). If the allocation request is for a file range that's adjacent to an existing mapping, it will then change bno_hint to the blkno hint in the bmalloca structure. In other words, bno_hint is either a rt block number, or it's all 1s. Unfortunately, commit ec12f97f1b8a8f didn't take the NULLRTBLOCK state into account, which means that it tries to translate that into a realtime extent number. We then end up with an obnoxiously high rtx number and pointlessly feed that to the near allocator. This often fails and falls back to the by-size allocator. Seeing as we had no locality hint anyway, this is a waste of time. Fix the code to detect a lack of bno_hint correctly. This was detected by running xfs/009 with metadir enabled and a 28k rt extent size. Cc: <[email protected]> # v6.12 Fixes: ec12f97f1b8a8f ("xfs: make the rtalloc start hint a xfs_rtblock_t") Signed-off-by: "Darrick J. Wong" <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_exchrange.c')
0 files changed, 0 insertions, 0 deletions