* Re: [PATCH] xattr: Fix error results for non-existent / invisible attributes
[not found] ` <20110620080921.GA23159@infradead.org>
@ 2011-06-21 1:34 ` Andreas Gruenbacher
0 siblings, 0 replies; only message in thread
From: Andreas Gruenbacher @ 2011-06-21 1:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Al Viro, linux-kernel, Andrew Morton, linux-fsdevel
On Mon, 2011-06-20 at 04:09 -0400, Christoph Hellwig wrote:
> On Fri, May 27, 2011 at 02:50:36PM +0200, Andreas Gruenbacher wrote:
> > Return -ENODATA when trying to read a user.* attribute which cannot
> > exist: user space otherwise does not have a reasonable way to
> > distinguish between non-existent and inaccessible attributes.
> >
> > Likewise, return -ENODATA when an unprivileged process tries to read a
> > trusted.* attribute: to unprivileged processes, those attributes are
> > invisible (listxattr() won't include them).
>
> This breaks xfstests 062.
The test does a "getfattr -n <name> <file>" for an attribute which
cannot exist. The kernel now returns ENODATA instead of the previous
EPERM.
One way to fix this in xfstests is to use listxattr(2) instead of
getxattr(2), e.g.,
- getfattr -m $nsp -n $nsp.name2 $SCRATCH_MNT/$inode
+ getfattr -m $nsp.name2 $SCRATCH_MNT/$inode
Another is to accept ENODATA as well as EPERM. Not sure which is preferable.
Andreas
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-21 1:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <201105271450.37089.agruen@kernel.org>
[not found] ` <20110620080921.GA23159@infradead.org>
2011-06-21 1:34 ` [PATCH] xattr: Fix error results for non-existent / invisible attributes Andreas Gruenbacher
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).