1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Initialize v_rdev in getnewvnode() - it appears that some filesystems

may not properly initialize this field in all cases, and this would
result in very anti-social behavior (overwriting on some other random
device/location).

Submitted by:	John Dyson
This commit is contained in:
David Greenman 1995-02-27 06:50:08 +00:00
parent 9ddf48f0d2
commit f9ceb7c7b5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6758
2 changed files with 6 additions and 4 deletions

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
* $Id: vfs_subr.c,v 1.15 1995/01/10 07:32:36 davidg Exp $
* $Id: vfs_subr.c,v 1.16 1995/02/22 09:39:22 davidg Exp $
*/
/*
@ -370,8 +370,9 @@ getnewvnode(tag, mp, vops, vpp)
vp->v_socket = 0;
vp->v_writecount = 0; /* XXX */
}
vp->v_type = VNON;
cache_purge(vp);
vp->v_type = VNON;
vp->v_rdev = NODEV;
vp->v_tag = tag;
vp->v_op = vops;
insmntque(vp, mp);

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
* $Id: vfs_subr.c,v 1.15 1995/01/10 07:32:36 davidg Exp $
* $Id: vfs_subr.c,v 1.16 1995/02/22 09:39:22 davidg Exp $
*/
/*
@ -370,8 +370,9 @@ getnewvnode(tag, mp, vops, vpp)
vp->v_socket = 0;
vp->v_writecount = 0; /* XXX */
}
vp->v_type = VNON;
cache_purge(vp);
vp->v_type = VNON;
vp->v_rdev = NODEV;
vp->v_tag = tag;
vp->v_op = vops;
insmntque(vp, mp);