diff options
| author | Gordon Ross <gwr@nexenta.com> | 2017-04-26 19:05:43 -0700 |
|---|---|---|
| committer | Gordon Ross <gwr@nexenta.com> | 2017-05-15 15:25:23 -0400 |
| commit | 4286ffae246c5943dbdc0d830e5e117c900d6baa (patch) | |
| tree | ed89f3df5e5f9f622d1a0aa8d00e3c51cca06e03 | |
| parent | faf269d301b574ab95145509e30b86f2caad6578 (diff) | |
| download | illumos-joyent-4286ffae246c5943dbdc0d830e5e117c900d6baa.tar.gz | |
7444 fs/xattr.c should be more transparent (zfs_acl_test)
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
| -rw-r--r-- | usr/src/uts/common/fs/xattr.c | 25 |
1 files 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); } |
