diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-23 22:38:15 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-23 22:38:15 +0000 |
commit | e7cd4ee72918e695c27b9c97831829b41f94273f (patch) | |
tree | 32b0f9b3a920ca1ad05f95af8b6fc6092b9ce728 /sys/fs/hpfs/hpfs_vfsops.c | |
parent | c55210afc563c7d266b94a9ca5e3c1e8259acd75 (diff) | |
download | FreeBSD-src-e7cd4ee72918e695c27b9c97831829b41f94273f.zip FreeBSD-src-e7cd4ee72918e695c27b9c97831829b41f94273f.tar.gz |
Proc locking to protect p_ucred while we obtain an additional reference.
Diffstat (limited to 'sys/fs/hpfs/hpfs_vfsops.c')
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index 628ec25..ab6d763 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -331,6 +331,9 @@ hpfs_mountfs(devvp, mp, argsp, p) struct hpfsmount *hpmp; struct buf *bp = NULL; struct vnode *vp; +#if defined(__FreeBSD__) + struct ucred *uc; +#endif dev_t dev = devvp->v_rdev; dprintf(("hpfs_mountfs():\n")); @@ -353,7 +356,12 @@ hpfs_mountfs(devvp, mp, argsp, p) #if defined(__FreeBSD__) VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p); - error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); + PROC_LOCK(p); + uc = p->p_ucred; + crhold(uc); + PROC_UNLOCK(p); + error = vinvalbuf(devvp, V_SAVE, uc, p, 0, 0); + crfree(uc); VOP__UNLOCK(devvp, 0, p); #else error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); |