linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	mtk.manpages@gmail.com,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	xfs <linux-xfs@vger.kernel.org>
Subject: Re: statx manpage
Date: Tue, 7 Mar 2017 14:55:33 -0800	[thread overview]
Message-ID: <20170307225533.GA1403@zzz> (raw)
In-Reply-To: <10435.1488907375@warthog.procyon.org.uk>

On Tue, Mar 07, 2017 at 05:22:55PM +0000, David Howells wrote:
> .fi
> .in
> .PP
> (Note that reserved space and padding is ommitted)

ommitted => omitted

> .TP
> .BR AT_EMPTY_PATH " (since Linux 2.6.39)"
...
> .TP
> .BR AT_NO_AUTOMOUNT " (since Linux 2.6.38)"

Given that statx is just being added now in 4.11, saying "since Linux 2.6.39"
and "since Linux 2.6.38" for these flags seems unneeded.

> The
> .I mask
> argument to
> .BR statx ()
> is used to tell the kernel which fields the caller is interested in
> .I mask
> is an OR'ed combination of the following constants:

Missing a period between "interested in" and "mask".

> .B "Do not"
> simply set
> .I mask
> to UINT_MAX as one or more bits may, in future, be used to specify an extension
> to the buffer.

"in future" => "in the future".

> .I Note:
> For performance and simplicity reasons, different fields in the
> .I statx
> structure may contain state information from different moments
> during the execution of the system call.
> For example, if
> .IR stx_mode
> or
> .IR stx_uid
> is changed by another process by calling
> .BR chmod (2)
> or
> .BR chown (2),
> .BR stat ()
> might return the old
> .I stx_mode
> together with the new
> .IR stx_uid ,
> or the old
> .I stx_uid
> together with the new
> .IR stx_mode .

This example is confusing because chmod() doesn't change st_uid, and chown()
doesn't ordinarily change st_mode.  A better example would be that if chown() is
used to change both the owner and group, it's possible that statx() would return
the new owner paired with the old group, or the new group paired with the old
owner.  Or, the new owner and group could be observed before the new ctime.
Also, it seems this note belongs in a BUGS section of the man page, since it is
a bug.

> .SH ERRORS
> .TP
> .B EINVAL
> Invalid flag specified in
> .IR flags .

Actually, the behavior when specifying invalid flags differs depending on
whether a path is specified.

If a path is specified, then statx() fails with EINVAL if unrecognized flags are
specified.

However, the behavior differs when no path is specified.  For example, the the
following call with invalid flags succeeds:

	statx(fd, NULL, 0xFFFF0000, 0, &stbuf);

I think this is a bug, and it should be fixed by applying the same 'flags'
validation regardless of whether a path is specified.

> .B ENOENT
> A component of
> .I pathname
> does not exist, or
> .I pathname
> is an empty string.

is an empty string and AT_EMPTY_PATH was not specified in flags.

> .SH SEE ALSO
> .BR ls (1),
> .BR stat (1),

Shouldn't this link to stat (2), not stat (1)?

- Eric

  parent reply	other threads:[~2017-03-07 22:56 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07  0:06 [PATCH] xfs: report crtime and attribute flags to statx Darrick J. Wong
2017-03-07  5:01 ` Christoph Hellwig
2017-03-07 17:23   ` Darrick J. Wong
2017-03-07 17:22 ` statx manpage David Howells
2017-03-07 18:02   ` Darrick J. Wong
2017-03-07 18:39   ` David Howells
2017-03-07 18:44     ` Darrick J. Wong
2017-03-07 18:55     ` David Howells
2017-03-07 21:44   ` Andreas Dilger
2017-03-07 22:55   ` Eric Biggers [this message]
2017-03-08  3:45   ` Eryu Guan
2017-03-08  9:24   ` David Howells
2017-03-08 15:26     ` Jeff Layton
2017-03-20 16:01       ` Matthew Wilcox
2017-03-22 10:55         ` Jeff Layton
2017-03-08  9:41   ` David Howells
2017-03-10  5:01     ` Eric Biggers
2017-03-09  6:46   ` David Howells
2017-03-09  6:59     ` Eryu Guan
2017-03-09  6:59     ` Darrick J. Wong
2017-03-09 14:01       ` Christoph Hellwig
2017-03-09  7:45     ` David Howells
2017-03-24 20:53   ` Eric Biggers
2017-03-27  0:46     ` Andreas Dilger
2017-03-27 15:40       ` Darrick J. Wong
2017-03-27 16:25       ` David Howells
2017-03-27 16:46         ` Christoph Hellwig
2017-03-27 19:04           ` Jeff Layton
2017-03-28 19:39             ` Andreas Dilger
2017-03-28 20:22               ` Jeff Layton
2017-03-31 15:49             ` Christoph Hellwig
2017-03-27 18:57         ` David Howells
2017-03-28  0:13         ` [PATCH] Add initial batch of statx() LTP tests David Howells
2017-03-28  6:28           ` Christoph Hellwig
2017-03-28  8:23           ` David Howells
2017-03-27  9:55   ` statx manpage David Howells
2017-03-31 15:56   ` Christoph Hellwig
2017-03-31 16:43   ` David Howells

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=20170307225533.GA1403@zzz \
    --to=ebiggers3@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /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).