mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-06-06 22:16:38 +03:00
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 <david.chen@osnexus.com>
This commit is contained in:
committed by
Brian Behlendorf
parent
7f547f85fe
commit
987014903f
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user