diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-11-01 11:57:22 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-11-05 15:52:40 +0100 |
| commit | 45eb9737058fa78a73f17a5da55c8cb482c6d5bb (patch) | |
| tree | 7a561da87f998abd7699b712ce1cb9fe954d3278 /include | |
| parent | 309f7a5585aeaf77d3d7c27304ac97e515447dac (diff) | |
libfs: end offset readdir at positions past DIR_OFFSET_EOD
offset_dir_llseek() takes any position up to LONG_MAX but
offset_readdir() only skips the walk for DIR_OFFSET_EOD itself. For a
position past it mas_find_rev() starts the walk at the highest offset
in the directory. So an lseek() past the end makes the next
getdents64() return the whole directory again.
Before commit b9b588f22a0c ("libfs: Use d_children list to iterate
simple_offset directories") the walk went up from the position and
found nothing past the end, and dcache_readdir() returns nothing there
either. So only walk for positions below DIR_OFFSET_EOD.
Fixes: b9b588f22a0c ("libfs: Use d_children list to iterate simple_offset directories")
Link: https://patch.msgid.link/20261101-work-libfs-offset_readdir-v2-3-c621125b56d1@kernel.org
Reviewed-by: Chuck Lever <cel@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
