Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2012 22:43:45 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243311 - in head/sys: fs/ext2fs fs/msdosfs fs/nfsclient fs/nullfs fs/unionfs gnu/fs/reiserfs nfsclient ufs/ffs
Message-ID:  <201211192243.qAJMhjFF055708@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Nov 19 22:43:45 2012
New Revision: 243311
URL: http://svnweb.freebsd.org/changeset/base/243311

Log:
  r16312 is not any longer real since many years (likely since when VFS
  received granular locking) but the comment present in UFS has been
  copied all over other filesystems code incorrectly for several times.
  
  Removes comments that makes no sense now.
  
  Reviewed by:	kib
  MFC after:	3 days

Modified:
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/msdosfs/msdosfs_denode.c
  head/sys/fs/nfsclient/nfs_clnode.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nullfs/null_subr.c
  head/sys/fs/unionfs/union_subr.c
  head/sys/gnu/fs/reiserfs/reiserfs_inode.c
  head/sys/nfsclient/nfs_node.c
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/fs/ext2fs/ext2_vfsops.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -905,14 +905,6 @@ ext2_vget(struct mount *mp, ino_t ino, i
 
 	ump = VFSTOEXT2(mp);
 	dev = ump->um_dev;
-
-	/*
-	 * If this malloc() is performed after the getnewvnode()
-	 * it might block, leaving a vnode with a NULL v_data to be
-	 * found by ext2_sync() if a sync happens to fire right then,
-	 * which will cause a panic because ext2_sync() blindly
-	 * dereferences vp->v_data (as well it should).
-	 */
 	ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO);
 
 	/* Allocate a new vnode/inode. */

Modified: head/sys/fs/msdosfs/msdosfs_denode.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_denode.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/fs/msdosfs/msdosfs_denode.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -142,12 +142,6 @@ deget(pmp, dirclust, diroffset, depp)
 		KASSERT((*depp)->de_diroffset == diroffset, ("wrong diroffset"));
 		return (0);
 	}
-
-	/*
-	 * Do the malloc before the getnewvnode since doing so afterward
-	 * might cause a bogus v_data pointer to get dereferenced
-	 * elsewhere if malloc should block.
-	 */
 	ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK | M_ZERO);
 
 	/*

Modified: head/sys/fs/nfsclient/nfs_clnode.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clnode.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/fs/nfsclient/nfs_clnode.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -122,12 +122,6 @@ ncl_nget(struct mount *mntp, u_int8_t *f
 		*npp = VTONFS(nvp);
 		return (0);
 	}
-
-	/*
-	 * Allocate before getnewvnode since doing so afterward
-	 * might cause a bogus v_data pointer to get dereferenced
-	 * elsewhere if zalloc should block.
-	 */
 	np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO);
 
 	error = getnewvnode("newnfs", mntp, &newnfs_vnodeops, &nvp);

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/fs/nfsclient/nfs_clport.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -197,12 +197,6 @@ nfscl_nget(struct mount *mntp, struct vn
 		FREE((caddr_t)nfhp, M_NFSFH);
 		return (0);
 	}
-
-	/*
-	 * Allocate before getnewvnode since doing so afterward
-	 * might cause a bogus v_data pointer to get dereferenced
-	 * elsewhere if zalloc should block.
-	 */
 	np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO);
 
 	error = getnewvnode("newnfs", mntp, &newnfs_vnodeops, &nvp);

Modified: head/sys/fs/nullfs/null_subr.c
==============================================================================
--- head/sys/fs/nullfs/null_subr.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/fs/nullfs/null_subr.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -236,10 +236,6 @@ null_nodeget(mp, lowervp, vpp)
 	 * duplicates later, when adding new vnode to hash.
 	 * Note that duplicate can only appear in hash if the lowervp is
 	 * locked LK_SHARED.
-	 *
-	 * Do the MALLOC before the getnewvnode since doing so afterward
-	 * might cause a bogus v_data pointer to get dereferenced
-	 * elsewhere if MALLOC should block.
 	 */
 	xp = malloc(sizeof(struct null_node), M_NULLFSNODE, M_WAITOK);
 

Modified: head/sys/fs/unionfs/union_subr.c
==============================================================================
--- head/sys/fs/unionfs/union_subr.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/fs/unionfs/union_subr.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -247,12 +247,6 @@ unionfs_nodeget(struct mount *mp, struct
 		if (dvp == NULLVP)
 			return (EINVAL);
 	}
-
-	/*
-	 * Do the MALLOC before the getnewvnode since doing so afterward
-	 * might cause a bogus v_data pointer to get dereferenced elsewhere
-	 * if MALLOC should block.
-	 */
 	unp = malloc(sizeof(struct unionfs_node),
 	    M_UNIONFSNODE, M_WAITOK | M_ZERO);
 

Modified: head/sys/gnu/fs/reiserfs/reiserfs_inode.c
==============================================================================
--- head/sys/gnu/fs/reiserfs/reiserfs_inode.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/gnu/fs/reiserfs/reiserfs_inode.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -757,13 +757,6 @@ reiserfs_iget(
 	rmp = VFSTOREISERFS(mp);
 	dev = rmp->rm_dev;
 
-	/*
-	 * If this malloc() is performed after the getnewvnode() it might
-	 * block, leaving a vnode with a NULL v_data to be found by
-	 * reiserfs_sync() if a sync happens to fire right then, which
-	 * will cause a panic because reiserfs_sync() blindly dereferences
-	 * vp->v_data (as well it should).
-	 */
 	reiserfs_log(LOG_DEBUG, "malloc(struct reiserfs_node)\n");
 	ip = malloc(sizeof(struct reiserfs_node), M_REISERFSNODE,
 	    M_WAITOK | M_ZERO);

Modified: head/sys/nfsclient/nfs_node.c
==============================================================================
--- head/sys/nfsclient/nfs_node.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/nfsclient/nfs_node.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -128,12 +128,6 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh
 		*npp = VTONFS(nvp);
 		return (0);
 	}
-
-	/*
-	 * Allocate before getnewvnode since doing so afterward
-	 * might cause a bogus v_data pointer to get dereferenced
-	 * elsewhere if zalloc should block.
-	 */
 	np = uma_zalloc(nfsnode_zone, M_WAITOK | M_ZERO);
 
 	error = getnewvnode("nfs", mntp, &nfs_vnodeops, &nvp);

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Mon Nov 19 21:58:14 2012	(r243310)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Mon Nov 19 22:43:45 2012	(r243311)
@@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags
 	ump = VFSTOUFS(mp);
 	dev = ump->um_dev;
 	fs = ump->um_fs;
-
-	/*
-	 * If this malloc() is performed after the getnewvnode()
-	 * it might block, leaving a vnode with a NULL v_data to be
-	 * found by ffs_sync() if a sync happens to fire right then,
-	 * which will cause a panic because ffs_sync() blindly
-	 * dereferences vp->v_data (as well it should).
-	 */
 	ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO);
 
 	/* Allocate a new vnode/inode. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211192243.qAJMhjFF055708>