diff options
author | Chunwei Chen <[email protected]> | 2016-10-12 17:30:46 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-11-04 10:46:40 -0700 |
commit | 987014903f9d36783547188b6ad00f01d9a076bd (patch) | |
tree | b128ec88349ecf9eae9fb75b11bc9e33d5e51f6b /module/zfs/zfs_acl.c | |
parent | 7f547f85fe783a6ac69ce250b361436b9c4888a6 (diff) |
Fix unlinked file cannot do xattr operations
Currently, doing things like fsetxattr(2) on an unlinked file will result in
ENODATA. There's two places that cause this: zfs_dirent_lock and zfs_zget.
The fix in zfs_dirent_lock is pretty straightforward. In zfs_zget though, we
need it to not return error when the zp is unlinked. This is a pretty big
change in behavior, but skimming through all the callers, I don't think this
change would cause any problem. Also there's nothing preventing z_unlinked
from being set after the z_lock mutex is dropped before but before zfs_zget
returns anyway.
The rest of the stuff is to make sure we don't log xattr stuff when owner is
unlinked.
Signed-off-by: Chunwei Chen <[email protected]>
Diffstat (limited to 'module/zfs/zfs_acl.c')
-rw-r--r-- | module/zfs/zfs_acl.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/module/zfs/zfs_acl.c b/module/zfs/zfs_acl.c index 7198c7ebf..defb8f448 100644 --- a/module/zfs/zfs_acl.c +++ b/module/zfs/zfs_acl.c @@ -2492,15 +2492,8 @@ zfs_zaccess(znode_t *zp, int mode, int flags, boolean_t skipaclchk, cred_t *cr) * If attribute then validate against base file */ if (is_attr) { - uint64_t parent; - - if ((error = sa_lookup(zp->z_sa_hdl, - SA_ZPL_PARENT(ZTOZSB(zp)), &parent, - sizeof (parent))) != 0) - return (error); - if ((error = zfs_zget(ZTOZSB(zp), - parent, &xzp)) != 0) { + zp->z_xattr_parent, &xzp)) != 0) { return (error); } |