diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2023-11-19 18:56:17 -0500 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-11-20 15:34:22 +0100 |
commit | 796432efab1e372d404e7a71cc6891a53f105051 (patch) | |
tree | 393f706088d6418bec28ace1db1670d0e8ecbf00 /lib | |
parent | 9c04138414c00ae61421f36ada002712c4bac94a (diff) |
libfs: getdents() should return 0 after reaching EOD
The new directory offset helpers don't conform with the convention
of getdents() returning no more entries once a directory file
descriptor has reached the current end-of-directory.
To address this, copy the logic from dcache_readdir() to mark the
open directory file descriptor once EOD has been reached. Seeking
resets the mark.
Reported-by: Tavian Barnes <tavianator@tavianator.com>
Closes: https://lore.kernel.org/linux-fsdevel/20231113180616.2831430-1-tavianator@tavianator.com/
Fixes: 6faddda69f62 ("libfs: Add directory operations for stable offsets")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://lore.kernel.org/r/170043792492.4628.15646203084646716134.stgit@bazille.1015granger.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions