Skip to content

Commit

Permalink
Only check directory xattr on ENOENT
Browse files Browse the repository at this point in the history
When SA xattrs are enabled only fallback to checking the directory
xattrs when the name is not found as a SA xattr.  Otherwise, the SA
error which should be returned to the caller is overwritten by the
directory xattr errors.  Positive return values indicating success
will also be immediately returned.

In the case of #1437 the ERANGE error was being correctly returned
by zpl_xattr_get_sa() only to be overridden with ENOENT which was
returned by the subsequent unnessisary call to zpl_xattr_get_dir().

Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1437
  • Loading branch information
behlendorf committed May 10, 2013
1 parent 4f34b3b commit 0377189
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zpl_xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ __zpl_xattr_get(struct inode *ip, const char *name, void *value, size_t size,

if (zsb->z_use_sa && zp->z_is_sa) {
error = zpl_xattr_get_sa(ip, name, value, size);
if (error >= 0)
if (error != -ENOENT)
goto out;
}

Expand Down

0 comments on commit 0377189

Please sign in to comment.