Skip to content
Unverified Commit 796432ef authored by Chuck Lever's avatar Chuck Lever Committed by Christian Brauner
Browse files

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: default avatarTavian Barnes <tavianator@tavianator.com>
Closes: https://lore.kernel.org/linux-fsdevel/20231113180616.2831430-1-tavianator@tavianator.com/


Fixes: 6faddda6 ("libfs: Add directory operations for stable offsets")
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Link: https://lore.kernel.org/r/170043792492.4628.15646203084646716134.stgit@bazille.1015granger.net


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 9c041384
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment