Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Feb 2009 21:08:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r188612 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb ufs/ffs
Message-ID:  <200902142108.n1EL8gQT030349@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sat Feb 14 21:08:40 2009
New Revision: 188612
URL: http://svn.freebsd.org/changeset/base/188612

Log:
  MFC r182366:
  In ffs_valloc(), ffs_vget() may fail because insmntque() refused to
  insert new vnode into the mount vnode list. Then, for the SU-enabled
  mount, ffs_vfree could create freefile dependency. This dependency can
  hang around forever since inode is not marked as IN_MODIFIED and
  correspondingly inodeblock may be not marked as dirty.
  
  After ffs_vget() fails, retry with FFSV_FORCEINSMQ, mark the inode as
  modified, and vput() it immediately. Take care of the dup alloc.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/ufs/ffs/ffs_alloc.c

Modified: stable/7/sys/ufs/ffs/ffs_alloc.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_alloc.c	Sat Feb 14 20:59:50 2009	(r188611)
+++ stable/7/sys/ufs/ffs/ffs_alloc.c	Sat Feb 14 21:08:40 2009	(r188612)
@@ -930,7 +930,7 @@ ffs_valloc(pvp, mode, cred, vpp)
 	struct timespec ts;
 	struct ufsmount *ump;
 	ino_t ino, ipref;
-	int cg, error;
+	int cg, error, error1;
 	static struct timeval lastfail;
 	static int curfail;
 
@@ -967,11 +967,21 @@ ffs_valloc(pvp, mode, cred, vpp)
 		goto noinodes;
 	error = ffs_vget(pvp->v_mount, ino, LK_EXCLUSIVE, vpp);
 	if (error) {
+		error1 = ffs_vgetf(pvp->v_mount, ino, LK_EXCLUSIVE, vpp,
+		    FFSV_FORCEINSMQ);
 		ffs_vfree(pvp, ino, mode);
+		if (error1 == 0) {
+			ip = VTOI(*vpp);
+			if (ip->i_mode)
+				goto dup_alloc;
+			ip->i_flag |= IN_MODIFIED;
+			vput(*vpp);
+		}
 		return (error);
 	}
 	ip = VTOI(*vpp);
 	if (ip->i_mode) {
+dup_alloc:
 		printf("mode = 0%o, inum = %lu, fs = %s\n",
 		    ip->i_mode, (u_long)ip->i_number, fs->fs_fsmnt);
 		panic("ffs_valloc: dup alloc");



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