From owner-svn-src-all@FreeBSD.ORG Thu Sep 5 04:00:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DBAB4856; Thu, 5 Sep 2013 04:00:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C8D8024FD; Thu, 5 Sep 2013 04:00:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8540mE2097313; Thu, 5 Sep 2013 04:00:48 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8540mU8097312; Thu, 5 Sep 2013 04:00:48 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201309050400.r8540mU8097312@svn.freebsd.org> From: Kirk McKusick Date: Thu, 5 Sep 2013 04:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r255231 - releng/9.2/sys/ufs/ufs X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 04:00:48 -0000 Author: mckusick Date: Thu Sep 5 04:00:48 2013 New Revision: 255231 URL: http://svnweb.freebsd.org/changeset/base/255231 Log: MFS of 255104: MFC of 253998: This bug fix is in a code path in rename taken when there is a collision between a rename and an open system call for the same target file. Here, rename releases its vnode references, waits for the open to finish, and then restarts by reacquiring its needed vnode locks. In this case, rename was unlocking but failing to release its reference to one of its held vnodes. The effect was that even after all the actual references to the vnode had gone, the vnode still showed active references. For files that had been removed, their space was not reclaimed until the filesystem was forcibly unmounted. This bug manifested itself in the Postgres server which would leak/lose hundreds of files per day amounting to many gigabytes of disk space. This bug required shutting down Postgres, forcibly unmounting its filesystem, remounting its filesystem and restarting Postgres every few days to recover the lost space. Reported by: Dan Thomas and Palle Girgensohn Bug-fix by: kib Tested by: Dan Thomas and Palle Girgensohn Approved by: re@ (Marius Strobl ) Modified: releng/9.2/sys/ufs/ufs/ufs_vnops.c Directory Properties: releng/9.2/sys/ (props changed) Modified: releng/9.2/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- releng/9.2/sys/ufs/ufs/ufs_vnops.c Thu Sep 5 03:46:44 2013 (r255230) +++ releng/9.2/sys/ufs/ufs/ufs_vnops.c Thu Sep 5 04:00:48 2013 (r255231) @@ -1271,7 +1271,7 @@ relock: error = VFS_VGET(mp, ino, LK_EXCLUSIVE, &nvp); if (error != 0) goto releout; - VOP_UNLOCK(nvp, 0); + vput(nvp); atomic_add_int(&rename_restarts, 1); goto relock; }