diff options
Diffstat (limited to 'sys/fs/pseudofs')
-rw-r--r-- | sys/fs/pseudofs/pseudofs.c | 5 | ||||
-rw-r--r-- | sys/fs/pseudofs/pseudofs_vncache.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c index a940012..8297ef6 100644 --- a/sys/fs/pseudofs/pseudofs.c +++ b/sys/fs/pseudofs/pseudofs.c @@ -75,6 +75,9 @@ _pfs_add_node(struct pfs_node *parent, struct pfs_node *node) node->pn_parent = parent; node->pn_next = parent->pn_nodes; parent->pn_nodes = node; + /* Propagate flag to all child nodes (and thus their vnodes) */ + if ((parent->pn_flags & PFS_PROCDEP) != 0) + node->pn_flags |= PFS_PROCDEP; mtx_unlock(&parent->pn_info->pi_mutex); return (0); @@ -129,7 +132,7 @@ pfs_create_dir(struct pfs_node *parent, char *name, dir->pn_type = (flags & PFS_PROCDEP) ? pfstype_procdir : pfstype_dir; dir->pn_attr = attr; dir->pn_vis = vis; - dir->pn_flags = flags & ~PFS_PROCDEP; + dir->pn_flags = flags; if (_pfs_add_node(parent, dir) != 0) { FREE(dir, M_PFSNODES); diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c index 8d142e9..1239f12 100644 --- a/sys/fs/pseudofs/pseudofs_vncache.c +++ b/sys/fs/pseudofs/pseudofs_vncache.c @@ -135,7 +135,7 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp, MALLOC(pvd, struct pfs_vdata *, sizeof *pvd, M_PFSVNCACHE, M_WAITOK); if (++pfs_vncache_entries > pfs_vncache_maxentries) pfs_vncache_maxentries = pfs_vncache_entries; - error = getnewvnode(VT_PSEUDOFS, mp, pfs_vnodeop_p, vpp); + error = getnewvnode("pseudofs", mp, pfs_vnodeop_p, vpp); if (error) return (error); pvd->pvd_pn = pn; @@ -165,6 +165,12 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp, default: panic("%s has unexpected type: %d", pn->pn_name, pn->pn_type); } + /* + * Propagate flag through to vnode so users know it can change + * if the process changes (i.e. execve) + */ + if ((pn->pn_flags & PFS_PROCDEP) != 0) + (*vpp)->v_vflag |= VV_PROCDEP; pvd->pvd_vnode = *vpp; mtx_lock(&pfs_vncache_mutex); pvd->pvd_prev = NULL; |