Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2013 00:18:26 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r255681 - stable/8/sys/ufs/ufs
Message-ID:  <201309190018.r8J0IQeR059092@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Thu Sep 19 00:18:25 2013
New Revision: 255681
URL: http://svnweb.freebsd.org/changeset/base/255681

Log:
  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

Modified:
  stable/8/sys/ufs/ufs/ufs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/ufs/   (props changed)

Modified: stable/8/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- stable/8/sys/ufs/ufs/ufs_vnops.c	Wed Sep 18 23:02:38 2013	(r255680)
+++ stable/8/sys/ufs/ufs/ufs_vnops.c	Thu Sep 19 00:18:25 2013	(r255681)
@@ -1242,7 +1242,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?201309190018.r8J0IQeR059092>