From 4286ffae246c5943dbdc0d830e5e117c900d6baa Mon Sep 17 00:00:00 2001 From: Gordon Ross Date: Wed, 26 Apr 2017 19:05:43 -0700 Subject: [PATCH] 7444 fs/xattr.c should be more transparent (zfs_acl_test) Reviewed by: Dan McDonald Reviewed by: Yuri Pankov Approved by: Matthew Ahrens --- usr/src/uts/common/fs/xattr.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/usr/src/uts/common/fs/xattr.c b/usr/src/uts/common/fs/xattr.c index 3f5e4078db..7373aaddbe 100644 --- a/usr/src/uts/common/fs/xattr.c +++ b/usr/src/uts/common/fs/xattr.c @@ -1174,16 +1174,25 @@ xattr_dir_access(vnode_t *vp, int mode, int flags, cred_t *cr, return (EACCES); } - /* - * If there is a real xattr directory, check access there; - * otherwise just return success. - */ error = xattr_dir_realdir(vp, &realvp, LOOKUP_XATTR, cr, ct); - if (error == 0) { - error = VOP_ACCESS(realvp, mode, flags, cr, ct); - } else { - error = 0; + if ((error == ENOENT || error == EINVAL)) { + /* + * These errors mean there's no "real" xattr dir. + * The GFS xattr dir always allows access. + */ + return (0); } + if (error != 0) { + /* + * The "real" xattr dir was not accessible. + */ + return (error); + } + /* + * We got the "real" xattr dir. + * Pass through the access call. + */ + error = VOP_ACCESS(realvp, mode, flags, cr, ct); return (error); } -- 2.11.4.GIT