here is the updated version of patch 4 which I was planning to use (minor rebase, and trivial checkpatch cleanup). Let me know if ok On Wed, Oct 5, 2022 at 11:36 PM Ronnie Sahlberg wrote: > > When application has done lseek() to a different offset on a directory fd > we skipped one entry too many before we start emitting directory entries > from the cache. > > Signed-off-by: Ronnie Sahlberg > --- > fs/cifs/readdir.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c > index 8e060c00c969..da0d1e188432 100644 > --- a/fs/cifs/readdir.c > +++ b/fs/cifs/readdir.c > @@ -847,9 +847,13 @@ static bool emit_cached_dirents(struct cached_dirents *cde, > int rc; > > list_for_each_entry(dirent, &cde->entries, entry) { > - if (ctx->pos >= dirent->pos) > + /* > + * Skip ahead until we get to the current position of the > + * directory. > + */ > + if (ctx->pos > dirent->pos) > continue; > - ctx->pos = dirent->pos; > + > rc = dir_emit(ctx, dirent->name, dirent->namelen, > dirent->fattr.cf_uniqueid, > dirent->fattr.cf_dtype); > -- > 2.35.3 > -- Thanks, Steve