Date: Thu, 4 Mar 2021 01:32:54 GMT From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 0dcfb6d761cc - stable/12 - getdirentries.2: fix for NFS mounts Message-ID: <202103040132.1241WsZl068391@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0dcfb6d761ccc8bd45b68231f9a5f4ff4c6d989f commit 0dcfb6d761ccc8bd45b68231f9a5f4ff4c6d989f Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-02-15 02:16:58 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-03-04 01:30:23 +0000 getdirentries.2: fix for NFS mounts It was reported that getdirentries(2) was returning dirents with d_off set to 0 for an NFS mount. This is believed to be correct behaviour at this time (it may change for some NFS mounts in the future), but is inconsistent with what the getdirentries(2) man page says. This patch fixes the man page. This is a content change. PR: 253428 (cherry picked from commit a0698341cd894ba4a640e9a9bb0f72c2133d1228) --- lib/libc/sys/getdirentries.2 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/libc/sys/getdirentries.2 b/lib/libc/sys/getdirentries.2 index f2d1c05240d5..658be9459af5 100644 --- a/lib/libc/sys/getdirentries.2 +++ b/lib/libc/sys/getdirentries.2 @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd February 14, 2021 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -89,7 +89,7 @@ have the same .Fa d_fileno . The .Fa d_off -field returns a cookie which can be used with +field returns a cookie which, if non-zero, can be used with .Xr lseek 2 to position the directory descriptor to the next entry. The @@ -148,14 +148,16 @@ only .Pc , a value returned in the .Fa d_off -field, +field if it is non-zero, or zero. .Sh IMPLEMENTATION NOTES The .Fa d_off -field is being used as a cookie to readdir for nfs servers. -These cookies can be cached and allow to read directory entries at a specific -offset on demand. +field is currently set to 0 by the NFS client, since the +directory offset cookies returned by an NFS server cannot +be used by +.Xr lseek 2 +at this time. .Sh RETURN VALUES If successful, the number of bytes actually transferred is returned. Otherwise, -1 is returned and the global variable
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103040132.1241WsZl068391>