summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorbpramod <none@none>2008-03-26 03:56:50 -0700
committerbpramod <none@none>2008-03-26 03:56:50 -0700
commit132c40dc222ee0e9f7faaa420d097f632a9d35bb (patch)
tree71a0a9ba2f73f5c54d8cc574ccd04548764234ca /usr/src
parent2e8a1712c9ef0c384682b03b664b5c2b6c8622fe (diff)
downloadillumos-joyent-132c40dc222ee0e9f7faaa420d097f632a9d35bb.tar.gz
6674153 statvfs on a named pipe fails after fix for 6606372
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/fifofs/fifosubr.c14
-rw-r--r--usr/src/uts/common/fs/fifofs/fifovnops.c5
2 files changed, 13 insertions, 6 deletions
diff --git a/usr/src/uts/common/fs/fifofs/fifosubr.c b/usr/src/uts/common/fs/fifofs/fifosubr.c
index f164420acd..4739875919 100644
--- a/usr/src/uts/common/fs/fifofs/fifosubr.c
+++ b/usr/src/uts/common/fs/fifofs/fifosubr.c
@@ -468,13 +468,17 @@ fifovp(vnode_t *vp, cred_t *crp)
newvp = FTOV(fnp);
fifo_reinit_vp(newvp);
-
/*
- * Store the'generic' fifovfs pointer in the fifo vnode.
- * It gets used in the VOPSTATS macros for accounting IO.
+ * Since the fifo vnode's v_vfsp needs to point to the
+ * underlying filesystem's vfsp we need to bump up the
+ * underlying filesystem's vfs reference count.
+ * The count is decremented when the fifo node is
+ * inactivated.
*/
- newvp->v_vfsp = fifovfsp;
- newvp->v_rdev = fifodev;
+
+ VFS_HOLD(vp->v_vfsp);
+ newvp->v_vfsp = vp->v_vfsp;
+ newvp->v_rdev = vp->v_rdev;
newvp->v_flag |= (vp->v_flag & VROOT);
fifoinsert(fnp);
diff --git a/usr/src/uts/common/fs/fifofs/fifovnops.c b/usr/src/uts/common/fs/fifofs/fifovnops.c
index dc50e1efc9..ac89e430c7 100644
--- a/usr/src/uts/common/fs/fifofs/fifovnops.c
+++ b/usr/src/uts/common/fs/fifofs/fifovnops.c
@@ -23,7 +23,7 @@
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1636,12 +1636,15 @@ fifo_inactive(vnode_t *vp, cred_t *crp, caller_context_t *ct)
/*
* remove fifo from fifo list so that no other process
* can grab it.
+ * Drop the reference count on the fifo node's
+ * underlying vfs.
*/
if (fnp->fn_realvp) {
(void) fiforemove(fnp);
mutex_exit(&ftable_lock);
(void) fifo_fsync(vp, FSYNC, crp, ct);
VN_RELE(fnp->fn_realvp);
+ VFS_RELE(vp->v_vfsp);
vp->v_vfsp = NULL;
} else
mutex_exit(&ftable_lock);