From owner-cvs-src-old@FreeBSD.ORG Sun Apr 24 10:48:10 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AC78106567C for ; Sun, 24 Apr 2011 10:48:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 884D88FC14 for ; Sun, 24 Apr 2011 10:48:10 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OAmAPF006173 for ; Sun, 24 Apr 2011 10:48:10 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p3OAmA30006172 for cvs-src-old@freebsd.org; Sun, 24 Apr 2011 10:48:10 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <201104241048.p3OAmA30006172@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Sun, 24 Apr 2011 10:47:56 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/ufs/ffs ffs_alloc.c src/sys/ufs/ufs ufs_extern.h ufs_inode.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:48:10 -0000 kib 2011-04-24 10:47:56 UTC FreeBSD src repository Modified files: sys/ufs/ffs ffs_alloc.c sys/ufs/ufs ufs_extern.h ufs_inode.c Log: SVN rev 220985 on 2011-04-24 10:47:56Z by kib VFS sometimes is unable to inactivate a vnode when vnode use count goes to zero. E.g., the vnode might be only shared-locked at the time of vput() call. Such vnodes are kept in the hash, so they can be found later. If ffs_valloc() allocated an inode that has its vnode cached in hash, and still owing the inactivation, then vget() call from ffs_valloc() clears VI_OWEINACT, and then the vnode is reused for the newly allocated inode. The problem is, the vnode is not reclaimed before it is put to the new use. ffs_valloc() recycles vnode vm object, but this is not enough. In particular, at least v_vflag should be cleared, and several bits of UFS state need to be removed. It is very inconvenient to call vgone() at this point. Instead, move some parts of ufs_reclaim() into helper function ufs_prepare_reclaim(), and call the helper from VOP_RECLAIM and ffs_valloc(). Reviewed by: mckusick Tested by: pho MFC after: 3 weeks Revision Changes Path 1.164 +2 -1 src/sys/ufs/ffs/ffs_alloc.c 1.59 +1 -0 src/sys/ufs/ufs/ufs_extern.h 1.74 +28 -22 src/sys/ufs/ufs/ufs_inode.c