linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shantanu Goel" <Shantanu.Goel@lehman.com>
To: linux-kernel@vger.kernel.org
Subject: [Fwd: [NFS PATCH] 2.6.0-test10 Invalidate cached inode attributes after rename]
Date: Fri, 28 Nov 2003 10:03:01 -0500	[thread overview]
Message-ID: <3FC763A5.6030404@lehman.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 979 bytes --]

I initially mailed this to the NFS mailing list on sourceforge.net but 
it doesn't seem to have made it through.

------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient of
this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information is
complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.

[-- Attachment #2: [NFS PATCH] 2.6.0-test10 Invalidate cached inode attributes after rename --]
[-- Type: message/rfc822, Size: 2022 bytes --]

From: "Shantanu Goel" <Shantanu.Goel@lehman.com>
To: nfs@lists.sourceforge.net
Subject: [NFS PATCH] 2.6.0-test10 Invalidate cached inode attributes after rename
Date: Wed, 26 Nov 2003 14:41:45 -0500
Message-ID: <3FC501F9.1050306@lehman.com>

Hi Trond et al,

The following one line patch invalidates the attributes of the 
underlying inode when a file is renamed.  Some filesystems update ctime 
upon rename().  One such filesystem is ext3, and a comment in the 
relevant code there indicates this is true with other Unix filesystems 
as well.
The following problem was observed on Fedora Core 1 running a stock 
kernel.org 2.6.0-test10.
The server is running Solaris 2.8 but I have verified the same issue 
exists with a server running Linix 2.4.22.  These operations a done via 
a Perl script.

1. Check out a CVS repository into an NFS mounted directory.
2. Move files from CVS working directory into another directory in the 
same filesystem.
3. Tar up the resultant directory.
4. Tar prints lots of "file changed after we read it" messages.

Tar obtains ctime via stat() before reading the file and compares it to 
the ctime obtained via fstat() after having read the file.  The two 
differ because the intervening open() forces an attribute refresh due to 
CTO consistency at which time ctime is updated.  Forcing a cache 
invalidation during rename() eliminates this particular scenario.

Thanks,
Shantanu

--- 2.6.0-test10/fs/nfs/dir.c.~1~    2003-10-17 17:43:11.000000000 -0400
+++ 2.6.0-test10/fs/nfs/dir.c    2003-11-26 12:42:27.000000000 -0500
@@ -1257,6 +1257,7 @@
 
     nfs_zap_caches(new_dir);
     nfs_zap_caches(old_dir);
+    NFS_CACHEINV(old_inode);
     error = NFS_PROTO(old_dir)->rename(old_dir, &old_dentry->d_name,
                        new_dir, &new_dentry->d_name);
 out:


             reply	other threads:[~2003-11-28 15:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-28 15:03 Shantanu Goel [this message]
2003-11-28 16:45 ` [Fwd: [NFS PATCH] 2.6.0-test10 Invalidate cached inode attributes after rename] Trond Myklebust
2003-11-28 16:50   ` Shantanu Goel
2003-11-28 17:05     ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FC763A5.6030404@lehman.com \
    --to=shantanu.goel@lehman.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).