diff options
| author | Christoph Hellwig <[email protected]> | 2025-01-16 06:01:41 +0000 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-01-16 09:19:59 +0000 |
| commit | 07eae0fa67ca4bbb199ad85645e0f9dfaef931cd (patch) | |
| tree | a91dceb852e028253fd45b4aff5efbff37e64d15 /fs/xfs/xfs_exchrange.c | |
| parent | xfs: add a b_iodone callback to struct xfs_buf (diff) | |
| download | kernel-07eae0fa67ca4bbb199ad85645e0f9dfaef931cd.tar.gz kernel-07eae0fa67ca4bbb199ad85645e0f9dfaef931cd.zip | |
xfs: check for dead buffers in xfs_buf_find_insert
Commit 32dd4f9c506b ("xfs: remove a superflous hash lookup when inserting
new buffers") converted xfs_buf_find_insert to use
rhashtable_lookup_get_insert_fast and thus an operation that returns the
existing buffer when an insert would duplicate the hash key. But this
code path misses the check for a buffer with a reference count of zero,
which could lead to reusing an about to be freed buffer. Fix this by
using the same atomic_inc_not_zero pattern as xfs_buf_insert.
Fixes: 32dd4f9c506b ("xfs: remove a superflous hash lookup when inserting new buffers")
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Cc: [email protected] # v6.0
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_exchrange.c')
0 files changed, 0 insertions, 0 deletions
