fs: fix and deduplicate whence handling in default_llseek()
Status from this message: Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in default_llseek()fs/ | +6 | 0 replies | |
| 2/2 | fs: use must_set_pos() in default_llseek()fs/ | +14 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jan Kara |
|---|---|
| Series | R-b |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 0/2] fs: fix and deduplicate whence handling in default_llseek()
This series fixes negative offset validation for SEEK_DATA and SEEK_HOLE in default_llseek() and deduplicates its whence handling with must_set_pos().
Patch 1 updates default_llseek() to read the inode size once via i_size_read(inode) and compare (unsigned long long)offset >= eof for SEEK_DATA and SEEK_HOLE so negative offsets fail with -ENXIO instead of bypassing the range check.
Patch 2 replaces the open-coded switch (whence) block in default_llseek() with a call to must_set_pos().
Siddharth Chintamaneni (2):
fs: reject negative offsets for SEEK_DATA and SEEK_HOLE in
default_llseek()
fs: use must_set_pos() in default_llseek()
fs/read_write.c | 48 ++++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-)
base-commit: 36aad21d50d1af3f6954bb0c988257a908202477
Signature · 1 line
2.50.1 (Apple Git-155)