]> git.proxmox.com Git - mirror_zfs.git/commit
Fix unlinked file cannot do xattr operations
authorChunwei Chen <david.chen@osnexus.com>
Thu, 13 Oct 2016 00:30:46 +0000 (17:30 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 4 Nov 2016 17:46:40 +0000 (10:46 -0700)
commit987014903f9d36783547188b6ad00f01d9a076bd
treeb128ec88349ecf9eae9fb75b11bc9e33d5e51f6b
parent7f547f85fe783a6ac69ce250b361436b9c4888a6
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>
include/sys/zfs_znode.h
module/zfs/zfs_acl.c
module/zfs/zfs_dir.c
module/zfs/zfs_log.c
module/zfs/zfs_znode.c