summaryrefslogtreecommitdiff
path: root/tools/testing/shared
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-05-18 08:02:05 +0200
committerCarlos Maiolino <cem@kernel.org>2026-05-21 13:43:58 +0200
commitc69439a891ccb37ede5d68539636337c6bd92fab (patch)
tree260f96ded264e775867828cc197ce2b8bb8edafd /tools/testing/shared
parent509fdeb3326be0db055e88d0f689a3888f147f90 (diff)
xfs: fix a buffer lookup against removal race
When a buffer is freed either by LRU eviction or because it is unset, the lockref is marked as dead instantly, which prevents the buffer from being used after finding it in the buffer hash in xfs_buf_lookup and xfs_buf_find_insert. But the latter will then not add the new buffer to the hash because it already found an existing buffer. Fix this using in two places: Remove the buffer from the hash before marking the lockref dead so that that no buffer with a dead lockref can be found in the hash, but if we find one in xfs_buf_find_insert due to store reordering, handle this case correctly instead of returning an unhashed buffer. Fixes: 67fe4303972e ("xfs: don't keep a reference for buffers on the LRU") Reported-by: Andrey Albershteyn <aalbersh@redhat.com> Reported-by: Carlos Maiolino <cem@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'tools/testing/shared')
0 files changed, 0 insertions, 0 deletions