mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +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
@@ -194,6 +194,7 @@ typedef struct znode {
|
||||
zfs_acl_t *z_acl_cached; /* cached acl */
|
||||
krwlock_t z_xattr_lock; /* xattr data lock */
|
||||
nvlist_t *z_xattr_cached; /* cached xattrs */
|
||||
uint64_t z_xattr_parent; /* parent obj for this xattr */
|
||||
list_node_t z_link_node; /* all znodes in fs link */
|
||||
sa_handle_t *z_sa_hdl; /* handle to sa data */
|
||||
boolean_t z_is_sa; /* are we native sa? */
|
||||
|
||||
Reference in New Issue
Block a user