Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965822AbdDZTJe (ORCPT ); Wed, 26 Apr 2017 15:09:34 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37255 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965753AbdDZTJS (ORCPT ); Wed, 26 Apr 2017 15:09:18 -0400 MIME-Version: 1.0 Reply-To: mtk.manpages@gmail.com In-Reply-To: <20166.1493219435@warthog.procyon.org.uk> References: <14390.1493206508@warthog.procyon.org.uk> <95977e2e-ac02-9960-4ed3-d9b988bed46a@gmail.com> <20166.1493219435@warthog.procyon.org.uk> From: "Michael Kerrisk (man-pages)" Date: Wed, 26 Apr 2017 21:08:56 +0200 Message-ID: Subject: Re: Revised statx(2) man page for review [and AT_EMPTY_PATH question] To: David Howells Cc: Alexander Viro , Jeff Layton , lkml , Linux API , linux-man , "Dmitry V. Levin" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3QJE5Zp002451 Content-Length: 5415 Lines: 147 Hi David, On 26 April 2017 at 17:10, David Howells wrote: > Michael Kerrisk (man-pages) wrote: > >> > This indicates what stx_attributes the VFS and filesystem actually support. >> > >> >> __s32 tv_nsec; /* Nanoseconds before or since tv_sec */ >> > >> > If you're going to do Dmitry's suggestion, then this needs to be __u32 and you >> > should remove "before or". >> >> I think the question is rather: what is going to be done to the API? >> Will it be changed as Dmitry suggests? > > I've forwarded Dmitry's patch to this effect. The man page now corresponds. >> Having two ways to do something is odd, and redundant. Note >> of the other APIs that provide this functionality do so >> in both ways, AFAIK. It's not a big problem, but certainly >> strange. If you settle on having just one, then I'd say >> choose AT_EMPTY_PATH. > > If I choose that, I presume I would have to give EINVAL if the path is NULL or > anything other than ""? AFAICS, just set lookup_flags to include LOOKUP_EMPTY and getname_flags() does the rest. (Essentially, AT_EMPTY_PATH is a safety catch for an empty path: if the path is nonempty, it is interpreted as usual, othewise if it is empty, you get ENOENT unless AT_EMPTY_PATH is also set. >> Under ERRORS I added: >> >> .TP >> .B EINVAL >> Reserved flag specified in >> .IR mask . >> >> Okay? > > That's fine. Thanks. >> >> It should be noted that the kernel may return fields that >> >> weren't requested and may fail to return fields that were >> >> requested, depending on what the backing filesystem supports. >> > >> > Maybe add "and can be safely ignored" in there somewhere since this seems to >> > be upsetting people. >> >> You say "in there somewhere", but it's not quite clear to me which piece >> this applies to. Could you propose a wording please. > > Can you do footnotes in roff? > > It should be noted that the kernel may return fields that > weren't requested[*] and may fail to return fields that were > requested, depending on what the backing filesystem supports. > > [*] These can be safely ignored. > > Or maybe: > > It should be noted that the kernel may return fields that > weren't requested and may fail to return fields that were > requested, depending on what the backing filesystem supports. > Fields that are given values despite being unrequested can just > be ignored. I took the second approach. >> >> If a filesystem does not support a field or if it has an unrep‐ >> >> resentable value (for instance, a file with an exotic type), >> >> then the mask bit corresponding to that field will be cleared >> >> in stx_mask even if the user asked for it and a dummy value >> >> will be filled in for compatibility purposes if one is avail‐ >> >> able (e.g., a dummy UID and GID may be specified to mount under >> >> some circumstances). >> > >> > I don't promise a dummy value for any "extended" field other than zero. >> >> I don't know what you mean to say here. Do you mean some >> text in the page should change? > > The paragraph promises a "dummy value will be filled in for compatibility > purposes if one is available", but doesn't place any restriction on the fields > towhich this applies. This is only true of the basic stat fields; all other > fields will be cleared if not set. > > Maybe we can just leave this as is. We're not promising a dummy field will > *always* be emplaced. We can always say that they're just not available for > extended fields if someone asks. > > Maybe the best thing to do is to simply add "and cleared otherwise." to the > end of the paragraph. Two points: * You do realize the text about "dummy values" was your original text? * Adding "and cleared otherwise" to end of the paragraph doesn't make sense. I'll leave the text as is, but if you want to propose a more complete phrasing, let me know. >> > Should this list either be in alphabetical order or offset-in-struct order? >> >> Probably the same order as the struct. > > Sounds good. Already done. >> Added. But, what does "no usable value here" mean? (The relationship >> between stx_attributes_mask and stx_attributes still isn't >> so clear to me. > > It's not so obvious with the bits that are currently defined. But I have a > patch that adds Windows attribute bits also (for cifs, ntfs, fat, ...). What > does it mean, say, if the archive bit is clear? Does it mean that archive > isn't set in the fs or that the fs doesn't support it? > > Further, I have plans to add a 'setattrx' syscall that takes a statx struct > and calls notify_change() with its contents in the kernel. If I do that, I > need to indicate to notify_change() what changes should be effected. stx_mask > covers most of the fields, but not stx_attributes. Some of these attributes > would be alterable. > > Would you prefer it to be reverted for the moment? To what does "it" refer? Anyway, I think we do need some better text describing these two fields and the difference between them. Can you come up with something? Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/