summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2016-10-07 18:56:24 +0000
committeravg <avg@FreeBSD.org>2016-10-07 18:56:24 +0000
commit266c82e9aed4518985b07bc51c6212344dc9731d (patch)
treef77b2a6cd8a00f3fb38d8b92ecea8d470807f132 /sys/cddl
parent8469a920dd0e1d08efcbd4e3672a51354dc0708b (diff)
downloadFreeBSD-src-266c82e9aed4518985b07bc51c6212344dc9731d.zip
FreeBSD-src-266c82e9aed4518985b07bc51c6212344dc9731d.tar.gz
MFC r306292: fix vnode lock assertion for extended attributes directory
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index e2fe974..aab1294 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -3197,6 +3197,11 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
if (err == 0 && xattr_obj) {
err = zfs_zget(zp->z_zfsvfs, xattr_obj, &attrzp);
+ if (err == 0) {
+ err = vn_lock(ZTOV(attrzp), LK_EXCLUSIVE);
+ if (err != 0)
+ vrele(ZTOV(attrzp));
+ }
if (err)
goto out2;
}
@@ -3206,7 +3211,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
if (new_uid != zp->z_uid &&
zfs_fuid_overquota(zfsvfs, B_FALSE, new_uid)) {
if (attrzp)
- vrele(ZTOV(attrzp));
+ vput(ZTOV(attrzp));
err = SET_ERROR(EDQUOT);
goto out2;
}
@@ -3218,7 +3223,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
if (new_gid != zp->z_gid &&
zfs_fuid_overquota(zfsvfs, B_TRUE, new_gid)) {
if (attrzp)
- vrele(ZTOV(attrzp));
+ vput(ZTOV(attrzp));
err = SET_ERROR(EDQUOT);
goto out2;
}
@@ -3449,7 +3454,7 @@ out:
}
if (attrzp)
- vrele(ZTOV(attrzp));
+ vput(ZTOV(attrzp));
if (aclp)
zfs_acl_free(aclp);
OpenPOWER on IntegriCloud