summaryrefslogtreecommitdiffstats
path: root/sys/fs/nullfs
diff options
context:
space:
mode:
authorpho <pho@FreeBSD.org>2011-10-24 10:35:37 +0000
committerpho <pho@FreeBSD.org>2011-10-24 10:35:37 +0000
commit2a208667af626e364488b574aa62b28b17301860 (patch)
treefe2a6aa3f54ab06a30ed5c37e065fd298965e384 /sys/fs/nullfs
parentc1182fb18dc82e2c0a064756f3b1a5c9897b32c0 (diff)
downloadFreeBSD-src-2a208667af626e364488b574aa62b28b17301860.zip
FreeBSD-src-2a208667af626e364488b574aa62b28b17301860.tar.gz
Only unlock if the lock is exclusive.
Reported by: Subbsd <subbsd gmail com> Discussed with: kib
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r--sys/fs/nullfs/null_vfsops.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
index e39dd8f..97f8f13 100644
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -104,11 +104,10 @@ nullfs_mount(struct mount *mp)
return (EINVAL);
/*
- * Unlock lower node to avoid deadlock.
- * (XXX) VOP_ISLOCKED is needed?
+ * Unlock lower node to avoid possible deadlock.
*/
if ((mp->mnt_vnodecovered->v_op == &null_vnodeops) &&
- VOP_ISLOCKED(mp->mnt_vnodecovered)) {
+ VOP_ISLOCKED(mp->mnt_vnodecovered) == LK_EXCLUSIVE) {
VOP_UNLOCK(mp->mnt_vnodecovered, 0);
isvnunlocked = 1;
}
OpenPOWER on IntegriCloud