Date: Tue, 6 Aug 2013 16:50:06 +0000 (UTC) From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253998 - head/sys/ufs/ufs Message-ID: <201308061650.r76Go6Wc074210@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mckusick Date: Tue Aug 6 16:50:05 2013 New Revision: 253998 URL: http://svnweb.freebsd.org/changeset/base/253998 Log: 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 MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Aug 6 16:18:07 2013 (r253997) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Aug 6 16:50:05 2013 (r253998) @@ -1263,7 +1263,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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308061650.r76Go6Wc074210>