linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: mtk.manpages@gmail.com
Cc: Ian Kent <ikent@redhat.com>, Jeff Layton <jlayton@redhat.com>,
	Trond Myklebust <trondmy@primarydata.com>,
	"viro\@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mkoutny\@suse.com" <mkoutny@suse.com>,
	"linux-nfs\@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-fsdevel\@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	David Howells <dhowells@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH manpages] stat.2: correct AT_NO_AUTOMOUNT text and general revisions.
Date: Fri, 25 Aug 2017 15:32:24 +1000	[thread overview]
Message-ID: <87valci55j.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <CAKgNAki1SYjr7-6g-i3shGjQRjwy81gS0QisfZRy-x-bHFtXmA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3545 bytes --]


Expand on the relationship between fstatat() and the other
three functions, and improve the description of AT_NO_AUTOMOUNT.
Specifically, both  stat() and lstat() act the same way
with respect to automounts, and that behavior matches
fstatat with the AT_NO_AUTOMOUNT flag.

The text in the NOTES is removed and places with the text for
AT_NO_AUTOMOUNT to improve cohesion.

New text for a difference to be introduced in 4.14.

Cc: Ian Kent <ikent@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.com>
---

Thanks Ian and Michael.  I considered your input and read
through the whole again, and came up with this which is
quite different to what I suggested before.

If this patch is applied, the result probably shouldn't be released
until the relevant patch actually lands in Linus's tree.

NeilBrown


 man2/stat.2 | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/man2/stat.2 b/man2/stat.2
index d8a9e76b3d9f..c6dddfe0d3a7 100644
--- a/man2/stat.2
+++ b/man2/stat.2
@@ -260,9 +260,12 @@ For further information on the above fields, see
 .SS fstatat()
 The
 .BR fstatat ()
-system call operates in exactly the same way as
+system call is a more general interface for accessing file information
+which can still provide exactly the behavior of each of
 .BR stat (),
-except for the differences described here.
+.BR lstat (),
+and
+.BR fstat ().
 .PP
 If the pathname given in
 .I pathname
@@ -272,6 +275,8 @@ referred to by the file descriptor
 (rather than relative to the current working directory of
 the calling process, as is done by
 .BR stat ()
+and
+.BR lstat ()
 for a relative pathname).
 .PP
 If
@@ -284,7 +289,9 @@ then
 .I pathname
 is interpreted relative to the current working
 directory of the calling process (like
-.BR stat ()).
+.BR stat ()
+and
+.BR lstat ()).
 .PP
 If
 .I pathname
@@ -307,7 +314,11 @@ is an empty string, operate on the file referred to by
 flag).
 In this case,
 .I dirfd
-can refer to any type of file, not just a directory.
+can refer to any type of file, not just a directory, and
+the behavior of
+.BR fstatat ()
+is similar to that of
+.BR fstat ().
 If
 .I dirfd
 is
@@ -324,6 +335,8 @@ Don't automount the terminal ("basename") component of
 if it is a directory that is an automount point.
 This allows the caller to gather attributes of an automount point
 (rather than the location it would mount).
+Since Linux 4.14, also don't instantiate a non-existent name in an
+on-demand directory such as used for automounter indirect maps.
 This flag can be used in tools that scan directories
 to prevent mass-automounting of a directory of automount points.
 The
@@ -333,6 +346,13 @@ This flag is Linux-specific; define
 .B _GNU_SOURCE
 .\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed
 to obtain its definition.
+Both
+.BR stat ()
+and
+.BR lstat ()
+act as though
+.B AT_NO_AUTOMOUNT
+was set.
 .TP
 .B AT_SYMLINK_NOFOLLOW
 If
@@ -474,15 +494,6 @@ fields may be less portable.
 The interpretation differs between systems,
 and possibly on a single system when NFS mounts are involved.)
 .SH NOTES
-On Linux,
-.BR lstat ()
-will generally not trigger automounter action, whereas
-.BR stat ()
-will (but see the description of the
-.BR fstatat ()
-.B AT_NO_AUTOMOUNT
-fag, above).
-.\"
 .SS Timestamp fields
 Older kernels and older standards did not support nanosecond timestamp
 fields.
-- 
2.14.0.rc0.dirty


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2017-08-25  5:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11  4:31 Do we really need d_weak_revalidate??? NeilBrown
2017-08-11  5:55 ` Trond Myklebust
2017-08-11 11:01   ` Jeff Layton
2017-08-13 23:36     ` NeilBrown
2017-08-14 10:10       ` Jeff Layton
2017-08-16  2:43         ` NeilBrown
2017-08-16 11:34           ` Jeff Layton
2017-08-16 23:47             ` NeilBrown
2017-08-17  2:20             ` Ian Kent
2017-08-18  5:24               ` NeilBrown
2017-08-18  6:47                 ` Ian Kent
2017-08-18  6:55                   ` Ian Kent
2017-08-21  6:23                   ` NeilBrown
2017-08-21  6:32                     ` Ian Kent
2017-08-21  7:46                       ` NeilBrown
2017-08-23  1:06                       ` NeilBrown
2017-08-23  2:32                         ` Ian Kent
2017-08-23  2:40                           ` Ian Kent
2017-08-23  2:54                             ` Ian Kent
2017-08-23  7:51                               ` Ian Kent
2017-08-24  3:21                             ` NeilBrown
2017-08-24  4:35                               ` Ian Kent
2017-08-24  4:07                           ` NeilBrown
2017-08-24  4:47                             ` Ian Kent
2017-08-24  4:58                             ` Ian Kent
2017-08-24 11:03                             ` Michael Kerrisk (man-pages)
2017-08-25  0:05                               ` Ian Kent
2017-08-25  5:32                               ` NeilBrown [this message]
2017-09-14 13:38                                 ` [PATCH manpages] stat.2: correct AT_NO_AUTOMOUNT text and general revisions Michael Kerrisk (man-pages)
2017-09-14 22:25                                   ` NeilBrown
2017-09-16 13:11                                     ` Michael Kerrisk (man-pages)
2017-09-08 15:15                             ` Do we really need d_weak_revalidate??? David Howells
2017-08-13 23:29   ` NeilBrown
2017-08-24  6:34     ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87valci55j.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=dhowells@redhat.com \
    --cc=hpa@zytor.com \
    --cc=ikent@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=mtk.manpages@gmail.com \
    --cc=trondmy@primarydata.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).