From owner-svn-src-head@FreeBSD.ORG Fri Mar 2 00:00:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22DA91065675 for ; Fri, 2 Mar 2012 00:00:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay02.pair.com (relay02.pair.com [209.68.5.16]) by mx1.freebsd.org (Postfix) with SMTP id CE6F88FC28 for ; Fri, 2 Mar 2012 00:00:32 +0000 (UTC) Received: (qmail 73669 invoked from network); 1 Mar 2012 23:33:51 -0000 Received: from 87.58.144.241 (HELO x2.osted.lan) (87.58.144.241) by relay02.pair.com with SMTP; 1 Mar 2012 23:33:51 -0000 X-pair-Authenticated: 87.58.144.241 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.4/8.14.4) with ESMTP id q21NXp0V025217; Fri, 2 Mar 2012 00:33:51 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.4/8.14.4/Submit) id q21NXpro025216; Fri, 2 Mar 2012 00:33:51 +0100 (CET) (envelope-from pho) Date: Fri, 2 Mar 2012 00:33:51 +0100 From: Peter Holm To: John Baldwin Message-ID: <20120301233351.GA24773@x2.osted.lan> References: <201110311501.p9VF1lrf020688@svn.freebsd.org> <201203011647.41313.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203011647.41313.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r226967 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 00:00:33 -0000 On Thu, Mar 01, 2012 at 04:47:41PM -0500, John Baldwin wrote: > On Monday, October 31, 2011 11:01:47 am Peter Holm wrote: > > Author: pho > > Date: Mon Oct 31 15:01:47 2011 > > New Revision: 226967 > > URL: http://svn.freebsd.org/changeset/base/226967 > > > > Log: > > The kern_renameat() looks up the fvp using the DELETE flag, which causes > > the removal of the name cache entry for fvp. > > > > Reported by: Anton Yuzhaninov > > In collaboration with: kib > > MFC after: 1 week > > > > Modified: > > head/sys/ufs/ufs/ufs_vnops.c > > So I ran into this at work recently, and even this fix applied I was still > seeing rename()'s that were seemingly not taking effect. After getting some > extra KTR traces, I figured out that the same purge needs to be applied to the > destination vnode. Specifically, the issue I ran into was that was renaming > 'foo' to 'bar', but lookups for 'bar' were still returning the old file. The > reason was that a lookup after the namei(RENAME) of the destination while > ufs_rename() had its locks dropped was readding the name cache entry for > 'bar', and then a cache_lookup() of 'bar' would return the old vnode as long > as that vnode was valid (e.g. if it had a link in another location, or other > processes had an open file descriptor for it). I'm currently testing the > patch below: > You wouldn't happen to have a small test scenario that demonstrates this? I'm not able to reproduce the problem, based on your description. I'll try some more tomorrow. - Peter