Page MenuHomeFreeBSD

D59725.diff
No OneTemporary

D59725.diff

diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -727,7 +727,8 @@
SESS_LOCK(p->p_session);
mtx_lock(&devfs_de_interlock);
VI_LOCK(vp);
- if (devfs_usecountl(vp) == 2 && !VN_IS_DOOMED(vp)) {
+ if (devfs_usecountl(vp) == 2 &&
+ !VN_IS_DOOMED(vp)) {
p->p_session->s_ttyvp = NULL;
p->p_session->s_ttydp = NULL;
oldvp = vp;
@@ -1306,9 +1307,6 @@
return (ENXIO);
}
- if (vp->v_type == VCHR)
- devfs_usecount_add(vp);
-
vlocked = VOP_ISLOCKED(vp);
VOP_UNLOCK(vp);
@@ -1328,8 +1326,8 @@
td->td_fpop = fpop;
vn_lock(vp, vlocked | LK_RETRY);
- if (error != 0 && vp->v_type == VCHR)
- devfs_usecount_sub(vp);
+ if (error == 0 && vp->v_type == VCHR)
+ devfs_usecount_add(vp);
dev_relthread(dev, ref);
if (error != 0) {
@@ -1661,7 +1659,6 @@
* Revoke is called on a tty when a terminal session ends. The vnode
* is orphaned by setting v_op to deadfs so we need to let go of it
* as well so that we create a new one next time around.
- *
*/
static int
devfs_revoke(struct vop_revoke_args *ap)

File Metadata

Mime Type
text/plain
Expires
Thu, Sep 17, 8:53 PM (1 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39077931
Default Alt Text
D59725.diff (1 KB)

Event Timeline