]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix skipping to incorrect offset in emit_cached_dirents
authorRonnie Sahlberg <lsahlber@redhat.com>
Tue, 11 Oct 2022 22:07:29 +0000 (08:07 +1000)
committerSteve French <stfrench@microsoft.com>
Tue, 11 Oct 2022 22:23:00 +0000 (17:23 -0500)
commit3d873843b8ba56d13616765be23da869ae3f518f
treee9f56ca634449722fd53b1119f8fd2f3a63127f0
parent414dcd889d8b857c2eb2a16852ab7adf59639943
cifs: fix skipping to incorrect offset in emit_cached_dirents

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.

We need to also make sure that when we are starting to emit directory
entries from the cache, the ->pos sequence might have holes and skip
some indices.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/readdir.c