]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
zfs: allow the lookup of extended attributes of an unlinked file
authoravg <avg@FreeBSD.org>
Mon, 2 Nov 2015 10:07:21 +0000 (10:07 +0000)
committeravg <avg@FreeBSD.org>
Mon, 2 Nov 2015 10:07:21 +0000 (10:07 +0000)
That's required for extattr_get_fd(2) and the like to work properly.

PR: 203201
MFC after: 17 days

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c

index e2a3bff645778bbae91fa52f8410e605e6388d61..cf42ff6c7cb39b67cc9211ffa11202216a4a93a1 100644 (file)
@@ -222,7 +222,7 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, znode_t **zpp,
 
        mutex_enter(&dzp->z_lock);
        for (;;) {
-               if (dzp->z_unlinked) {
+               if (dzp->z_unlinked && !(flag & ZXATTR)) {
                        mutex_exit(&dzp->z_lock);
                        if (!(flag & ZHAVELOCK))
                                rw_exit(&dzp->z_name_lock);