diff options
| author | Linus Torvalds <[email protected]> | 2025-03-06 17:33:58 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2025-03-06 17:33:58 +0000 |
| commit | d810d4c27bf34c719243bab9feb0d843edc09fd7 (patch) | |
| tree | 3e9336008e89eecda4b375cd2aff5c5a475638f8 /net/switchdev/switchdev.c | |
| parent | fs/pipe: express 'pipe_empty()' in terms of 'pipe_occupancy()' (diff) | |
| download | kernel-d810d4c27bf34c719243bab9feb0d843edc09fd7.tar.gz kernel-d810d4c27bf34c719243bab9feb0d843edc09fd7.zip | |
fs/pipe: do not open-code pipe head/tail logic in FIONREAD
Rasmus points out that we do indeed have other cases of breakage from
the type changes that were introduced on 32-bit targets in order to read
the pipe head and tail values atomically (commit 3d252160b818: "fs/pipe:
Read pipe->{head,tail} atomically outside pipe->mutex").
Fix it up by using the proper helper functions that now deal with the
pipe buffer index types properly. This makes the code simpler and more
obvious.
The compiler does the CSE and loop hoisting of the pipe ring size
masking that we used to do manually, so open-coding this was never a
good idea.
Reported-by: Rasmus Villemoes <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Fixes: 3d252160b818 ("fs/pipe: Read pipe->{head,tail} atomically outside pipe->mutex")Cc: Oleg Nesterov <[email protected]>
Cc: Mateusz Guzik <[email protected]>
Cc: K Prateek Nayak <[email protected]>
Cc: Swapnil Sapkal <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions
