From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Harkes Subject: Re: [PATCH 2.4.19pre8][RFC] remove-NFS-close-to-open from VFS (was Re: [PATCHSET] 2.4.19-pre8-jp12) Date: Fri, 18 Oct 2002 14:23:52 -0400 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20021018182352.GA13649@ravel.coda.cs.cmu.edu> References: <20020517034357.GA18449@ravel.coda.cs.cmu.edu> <20021017203804.GA24523@ravel.coda.cs.cmu.edu> <15791.12331.663212.692225@charged.uio.no> <20021017221652.GA26692@ravel.coda.cs.cmu.edu> <15791.20061.369962.893823@charged.uio.no> <20021018164916.GA11336@ravel.coda.cs.cmu.edu> <15792.16095.699839.453962@charged.uio.no> <20021018171211.GA12509@ravel.coda.cs.cmu.edu> <15792.18388.849961.869579@charged.uio.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: To: Trond Myklebust Content-Disposition: inline In-Reply-To: <15792.18388.849961.869579@charged.uio.no> List-Id: linux-fsdevel.vger.kernel.org On Fri, Oct 18, 2002 at 07:41:40PM +0200, Trond Myklebust wrote: > >>>>> " " == Jan Harkes writes: > > > So, we're not really revalidating the dcache entry at > > all. Maybe the code really wants to revalidate the inode. > > That is indeed the correct thing to do here according to POSIX, and is > really all I want to do for NFS too. For that reason, I originally > proposed to use i_op->revalidate(), but that was vetoed as you may > recall. It was? I really hope I wasn't one of the veto-ers because looking at this problem it does seem like the correct thing to do as we're not trying to see whether the path is correct, but only the object. Ok, it will cost Coda a whole upcall/context switch, but as it is '.' we're talking about it should already be locally cached. btw. you can easily drop the lookup in nfs_lookup_revalidate. It is a bug for this case, and not necessary in all other places d_revalidate is called as the VFS already uses real_lookup in those cases. Jan Haven't tried to compile it yet, but I guess it would look something like this? diff -urN linux-2.4.19/fs/namei.c linux-2.4.19-revalidate/fs/namei.c --- linux-2.4.19/fs/namei.c 2002-08-28 01:07:35.000000000 -0400 +++ linux-2.4.19-revalidate/fs/namei.c 2002-10-18 14:21:13.000000000 -0400 @@ -633,9 +633,12 @@ * Check the cached dentry for staleness. */ dentry = nd->dentry; - if (dentry && dentry->d_op && dentry->d_op->d_revalidate) { + if (dentry) { err = -ESTALE; - if (!dentry->d_op->d_revalidate(dentry, 0)) { + if (!dentry->d_inode || is_bad_inode(dentry->d_inode) || + (dentry->d_inode->i_op && + dentry->d_inode->i_op->revalidate && + !dentry->d_inode->i_op->revalidate(dentry))) { d_invalidate(dentry); break; }