linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shenghui <crosslonelyover@gmail.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: kernel-janitors <kernel-janitors@vger.kernel.org>,
	linux-ext4 <linux-ext4@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ext2: return -ENODATA for NULL i_file_acl in ext2_xattr_list
Date: Wed, 14 Jul 2010 07:47:36 +0800	[thread overview]
Message-ID: <AANLkTinbNujdr6qM7kMyOLFMqjRibwvLZIfMB6J3MzX3@mail.gmail.com> (raw)
In-Reply-To: <7D4617C2-565E-4F34-94B4-3F308EB75D18@dilger.ca>

2010/7/14 Andreas Dilger <adilger@dilger.ca>:
> The "error" value gets overwritten almost immediately with -EIO, and then at the end of the function if there is an xattr block but it doesn't contain any attributes (I'm not sure if this could happen, but it seems possible) it will return "error = buffer_size - rest;  /* total size */", so 0 if "rest" was not changed from its initial value of buffer_size.
>
> The question is why this return value should be changed to -ENODATA in the first place?  This isn't true for ext3_xattr_list() or ext4_xattr_list().  I tend to think it is not an error to get back an empty list, and applications shouldn't treat it as such.  Most applications will check "if (rc < 0)" and treat it as an error.  This is different than e.g. requesting a specific value by name (which does return -ENODATA) because it would otherwise be ambiguous whether the xattr existed but had zero size or didn't exist at all.
>

Thanks for your explanation!

-- 


Thanks and Best Regards,
shenghui
--
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

  reply	other threads:[~2010-07-13 23:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 14:55 [PATCH] ext2: return -ENODATA for NULL i_file_acl in ext2_xattr_list Wang Sheng-Hui
2010-07-13 18:36 ` Andreas Dilger
2010-07-13 23:47   ` shenghui [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-07-13 15:15 Wang Sheng-Hui

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=AANLkTinbNujdr6qM7kMyOLFMqjRibwvLZIfMB6J3MzX3@mail.gmail.com \
    --to=crosslonelyover@gmail.com \
    --cc=adilger@dilger.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).