public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtime attribute is not being updated on client
@ 2005-04-08  0:52 Linda Dunaphant
  2005-04-08 13:11 ` Trond Myklebust
  0 siblings, 1 reply; 9+ messages in thread
From: Linda Dunaphant @ 2005-04-08  0:52 UTC (permalink / raw)
  To: trond.myklebust; +Cc: linux-kernel

Hi Trond,
 
The acregmin (default=3) and acregmax (default=60) NFS attributes that
control the min and max attribute cache lifetimes don't appear to be
working after the first few timeouts. Using a test program that loops
on the following sequence:
        - write to a file on an NFS3 mounted filesystem from the client
        - sleep for one second
        - stat the file to get the mtime
you see the mtime change once after ~56 seconds, but no further mtime
changes are detected by the test.
  
nfs_refresh_inode() currently bypasses the inode vs fattr mtime comparison
if data_unstable is true. At the end of nfs_refresh_inode(), it resets the
attribute timer. Since nfs_refresh_inode() is being called after every
write to the server (which occurs more often than the attribute timer is
set to expire), the attribute timer never expires again for this file past
the ~56 sec point.
 
In nfs_refresh_inode() I believe the mtime comparison should be moved outside
the check for data_unstable. The server might already have a newer value for
mtime than the value on the client. With this change, the test sees the mtime
change after each write completes on the server.
 
Regards,
Linda
  
The following patch is for 2.6.12-rc2:
  
diff -Nura base/fs/nfs/inode.c new/fs/nfs/inode.c
--- base/fs/nfs/inode.c 2005-04-07 16:04:40.933611205 -0400
+++ new/fs/nfs/inode.c  2005-04-07 16:12:34.484299540 -0400
@@ -1176,9 +1176,11 @@
        }
   
        /* Verify a few of the more important attributes */
+       if (!timespec_equal(&inode->i_mtime, &fattr->mtime))
+               nfsi->flags |= NFS_INO_INVALID_ATTR;
+
        if (!data_unstable) {
-               if (!timespec_equal(&inode->i_mtime, &fattr->mtime)
-                               || cur_size != new_isize)
+               if (cur_size != new_isize)
                        nfsi->flags |= NFS_INO_INVALID_ATTR;
        } else if (S_ISREG(inode->i_mode) && new_isize > cur_size)
                        nfsi->flags |= NFS_INO_INVALID_ATTR;



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-06-07 22:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-08  0:52 [PATCH] mtime attribute is not being updated on client Linda Dunaphant
2005-04-08 13:11 ` Trond Myklebust
2005-04-08 20:54   ` Linda Dunaphant
2005-04-09  1:23     ` Linda Dunaphant
2005-06-07  0:28       ` Linda Dunaphant
2005-06-07  2:29         ` NFS: NFS3 lookup fails if creating a file with O_EXCL & multiple mountpoints in pathname Linda Dunaphant
2005-06-07  3:01           ` Trond Myklebust
2005-06-07 13:41           ` Trond Myklebust
2005-06-07 22:10             ` Linda Dunaphant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox