Summary: | [fusefs] driver doesn't populate dirent->d_off | ||
---|---|---|---|
Product: | Base System | Reporter: | John Millikin <jmillikin> |
Component: | kern | Assignee: | Alan Somers <asomers> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | asomers, cem, emaste |
Priority: | --- | Flags: | asomers:
mfc-stable13+
asomers: mfc-stable12+ |
Version: | 12.2-RELEASE | ||
Hardware: | Any | ||
OS: | Any | ||
URL: | https://reviews.freebsd.org/D28605 |
Description
John Millikin
2021-02-10 14:05:31 UTC
Yep, this looks like a bug. telldir/seekdir works because they ignore d_off. But getdirentries/lseek doesn't. FWIW, d_off is also used for NFS cookies, I think. This could mean that large FUSE directory listings on a FreeBSD NFS server wouldn't work correctly for clients. John, could you please test the code in the linked review? (In reply to Alan Somers from comment #3) Thanks, I've verified the linked review fixes this bug for me. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=71befc35061b3c9d8cc07e34c5dce622c848fcdb commit 71befc35061b3c9d8cc07e34c5dce622c848fcdb Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-02-12 01:01:10 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-02-13 04:50:52 +0000 fusefs: set d_off during VOP_READDIR This allows d_off to be used with lseek to position the file so that getdirentries(2) will return the next entry. It is not used by readdir(3). PR: 253411 Reported by: John Millikin <jmillikin@gmail.com> Reviewed by: cem MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28605 sys/fs/fuse/fuse_internal.c | 13 ++++---- tests/sys/fs/fusefs/Makefile | 3 ++ tests/sys/fs/fusefs/readdir.cc | 74 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 16 deletions(-) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=dc559c846d052ccb1996adcac2e6aba1675b4627 commit dc559c846d052ccb1996adcac2e6aba1675b4627 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-02-12 01:01:10 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-03-21 02:00:33 +0000 fusefs: set d_off during VOP_READDIR This allows d_off to be used with lseek to position the file so that getdirentries(2) will return the next entry. It is not used by readdir(3). PR: 253411 Reported by: John Millikin <jmillikin@gmail.com> Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D28605 (cherry picked from commit 71befc35061b3c9d8cc07e34c5dce622c848fcdb) sys/fs/fuse/fuse_internal.c | 13 ++++---- tests/sys/fs/fusefs/Makefile | 3 ++ tests/sys/fs/fusefs/readdir.cc | 74 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 16 deletions(-) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e02c4d8d9bc7c8a0ba4477c31cbac5b67283ea06 commit e02c4d8d9bc7c8a0ba4477c31cbac5b67283ea06 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2021-02-12 01:01:10 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2021-04-08 21:32:59 +0000 fusefs: set d_off during VOP_READDIR This allows d_off to be used with lseek to position the file so that getdirentries(2) will return the next entry. It is not used by readdir(3). PR: 253411 Reported by: John Millikin <jmillikin@gmail.com> Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D28605 (cherry picked from commit 71befc35061b3c9d8cc07e34c5dce622c848fcdb) sys/fs/fuse/fuse_internal.c | 13 ++++---- tests/sys/fs/fusefs/Makefile | 3 ++ tests/sys/fs/fusefs/readdir.cc | 74 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 74 insertions(+), 16 deletions(-) |