From: David Howells <dhowells@redhat.com>
To: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org,
linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
samba-technical@lists.samba.org, linux-ext4@vger.kernel.org,
linux-api@vger.kernel.org
Subject: Re: [PATCH] Add a pair of system calls to make extended file stats available [ver #3]
Date: Fri, 09 Jul 2010 14:59:06 +0100 [thread overview]
Message-ID: <21105.1278683946@redhat.com> (raw)
In-Reply-To: <AANLkTikP-u1adVItGDgUZdee14Z13k8MLRC5V7UN-gpV@mail.gmail.com>
Michael Kerrisk <mtk.manpages@gmail.com> wrote:
> > struct xstat_parameters {
> > unsigned long long request_mask;
>
> Poor name, since it's a value-result arg? Better maybe something like
> "field_mask"?
No. The contents of xstat_parameters aren't changed. request_mask is what
you're asking for, result_mask in the xstat struct is what you actually got.
result_mask may be more or less than request_mask as the filesystem isn't
obliged to supply anything you didn't ask for, and may not be able to supply
something you did ask for, and may give you stuff anyway that you didn't ask
for if it's trivial to do so.
> There is no XSTAT_REQUEST__GET_ANYWAY, AFAICS. I guess here you meant
> XSTAT_REQUEST__EXTENDED_STATS? Or?
Yep. I forgot to change that in the patch description.
> This case is almost certainly a user error, so why not simply return
> an error (-1 and ERANGE or E2BIG)? The above approach invites
> userspace errors of the form:
>
> if (xtat(...) < 0) { /* How users often check for error */
> /* I'll handle the error */
> } else {
> /* The call succeeded; I'm fine */
> }
I suppose.
> If you are looking for a way to inform the user about the required
> buffer size, I think it would be better to take a leaf from the
> getxattr(2) book: if 'buflen' is zero, then do nothing with the output
> arg, but return the size that would be required.
That's reasonable.
David
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2010-07-09 13:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-30 23:36 [PATCH] Add a pair of system calls to make extended file stats available [ver #3] David Howells
[not found] ` <20100630233614.32422.97038.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2010-07-02 5:36 ` Michael Kerrisk
2010-07-02 15:49 ` Andreas Dilger
2010-07-04 4:33 ` Michael Kerrisk
2010-07-04 21:06 ` Andreas Dilger
2010-07-05 14:10 ` David Howells
2010-07-05 14:59 ` David Howells
[not found] ` <4859.1278341989-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-07 14:57 ` Andreas Dilger
[not found] ` <9A36AB6B-7EC3-4789-89CD-D00715BEF34C-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>
2010-07-07 15:28 ` David Howells
2010-07-08 19:44 ` Michael Kerrisk
2010-07-09 13:59 ` David Howells [this message]
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=21105.1278683946@redhat.com \
--to=dhowells@redhat.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=samba-technical@lists.samba.org \
/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).