All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K. V" <aneesh.kumar@linux.vnet.ibm.com>
To: "Theodore Ts'o" <tytso@mit.edu>,
	linux-fsdevel@vger.kernel.org, a.gruenbacher@bestbits.at,
	Wang Sheng-Hui <crosslonelyover@gmail.com>,
	Michael Kerrisk <mtk.manpages@googlemail.com>
Subject: Re: What should listxattr() return if there are no xattrs?
Date: Tue, 21 Dec 2010 09:57:17 +0530	[thread overview]
Message-ID: <m3zkrzoimy.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <E1PUflN-0006QE-9s@tytso-glaptop>

On Mon, 20 Dec 2010 08:26:53 -0500, "Theodore Ts'o" <tytso@mit.edu> wrote:
> 
> Wang Sheng-Hui has sent some patches that change listxattr for the extN
> file systems to return ENODATA when an inode has no extended attributes
> (instead of zero).
> 
> I've noted that neither btrfs nor XFS do this, and would have rejected
> the patches on that basis. However, I'll note the man page for the
> listxattr(2) syscall is ambiguous:
> 
>     On  success,  a  positive number is returned indicating the size of the
>     extended attribute name list.  On failure, -1 is returned and errno  is
>     set appropriately.
> 
> It states that on success a _positive_ number is returned.  I've looked
> and this wordining is in SGI's man page as well.  I suspect the man page
> should be corrected to sate that "non-negative" number is returned?

I agree that man page needs update. Note that getfattr code does

	length = do_listxattr(path, NULL, 0);
	if (length < 0) {
		fprintf(stderr, "%s: %s: %s\n", progname, xquote(path, "\n\r"),
			strerror_ea(errno));
		had_errors++;
		return 1;
	} else if (length == 0)
		return 0;
		

-aneesh

  reply	other threads:[~2010-12-21  4:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 13:26 What should listxattr() return if there are no xattrs? Theodore Ts'o
2010-12-21  4:27 ` Aneesh Kumar K. V [this message]
2010-12-22  4:28 ` Jeremy Allison
2013-01-18 22:58 ` Michael Kerrisk (man-pages)

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=m3zkrzoimy.fsf@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=a.gruenbacher@bestbits.at \
    --cc=crosslonelyover@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mtk.manpages@googlemail.com \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.