diff options
| author | Christoph Hellwig <[email protected]> | 2025-01-16 06:01:42 +0000 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-01-16 09:19:59 +0000 |
| commit | ee10f6fcdb961e810d7b16be1285319c15c78ef6 (patch) | |
| tree | 922781843c3071785b84fdb05fc6171c5010b0f9 /fs/xfs/xfs_exchrange.c | |
| parent | xfs: check for dead buffers in xfs_buf_find_insert (diff) | |
| download | kernel-ee10f6fcdb961e810d7b16be1285319c15c78ef6.tar.gz kernel-ee10f6fcdb961e810d7b16be1285319c15c78ef6.zip | |
xfs: fix buffer lookup vs release race
Since commit 298f34224506 ("xfs: lockless buffer lookup") the buffer
lookup fastpath is done without a hash-wide lock (then pag_buf_lock, now
bc_lock) and only under RCU protection. But this means that nothing
serializes lookups against the temporary 0 reference count for buffers
that are added to the LRU after dropping the last regular reference,
and a concurrent lookup would fail to find them.
Fix this by doing all b_hold modifications under b_lock. We're already
doing this for release so this "only" ~ doubles the b_lock round trips.
We'll later look into the lockref infrastructure to optimize the number
of lock round trips again.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_exchrange.c')
0 files changed, 0 insertions, 0 deletions
