HomeFreeBSD

Fix unlinked file cannot do xattr operations

Description

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>

Details

Provenance
Chunwei Chen <david.chen@osnexus.com>Authored on Oct 13 2016, 12:30 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Nov 4 2016, 5:46 PM
Parents
rG7f547f85fe78: Add parity generation/rebuild using AVX-512 for x86-64
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG987014903f9d: Fix unlinked file cannot do xattr operations (authored by Chunwei Chen <david.chen@osnexus.com>).Nov 4 2016, 5:46 PM