mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.4.19-rc1 Fix NFS attribute caching bug
@ 2002-06-25 19:15 Trond Myklebust
  2002-06-25 23:20 ` Phil Oester
  0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2002-06-25 19:15 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Linux Kernel


  Fixes an obvious bug in __nfs_refresh_inode(): after updating the
attribute cache, if we discover that the data cache is invalid don't
call nfs_zap_caches() as that will also reinvalidate the attribute
cache.
  This bug plays havoc with the new lookup/revalidation code in 2.4.19
since it forces a lot of unnecessary extra GETATTR RPC calls.

Cheers,
   Trond

diff -u --recursive --new-file linux-2.4.19-pre10/fs/nfs/inode.c linux-2.4.19-fix_refresh1/fs/nfs/inode.c
--- linux-2.4.19-pre10/fs/nfs/inode.c	Tue Mar 12 16:35:02 2002
+++ linux-2.4.19-fix_refresh1/fs/nfs/inode.c	Tue Jun 25 17:40:36 2002
@@ -1087,14 +1087,17 @@
  		inode->i_rdev = to_kdev_t(fattr->rdev);
  
 	/* Update attrtimeo value */
-	if (!invalid && time_after(jiffies, NFS_ATTRTIMEO_UPDATE(inode)+NFS_ATTRTIMEO(inode))) {
+	if (invalid) {
+		NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode);
+		NFS_ATTRTIMEO_UPDATE(inode) = jiffies;
+		invalidate_inode_pages(inode);
+		memset(NFS_COOKIEVERF(inode), 0, sizeof(NFS_COOKIEVERF(inode)));
+	} else if (time_after(jiffies, NFS_ATTRTIMEO_UPDATE(inode)+NFS_ATTRTIMEO(inode))) {
 		if ((NFS_ATTRTIMEO(inode) <<= 1) > NFS_MAXATTRTIMEO(inode))
 			NFS_ATTRTIMEO(inode) = NFS_MAXATTRTIMEO(inode);
 		NFS_ATTRTIMEO_UPDATE(inode) = jiffies;
 	}
 
-	if (invalid)
-		nfs_zap_caches(inode);
 	return 0;
  out_nochange:
 	if (new_atime - inode->i_atime > 0)

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

* Re: [PATCH] 2.4.19-rc1 Fix NFS attribute caching bug
  2002-06-25 19:15 [PATCH] 2.4.19-rc1 Fix NFS attribute caching bug Trond Myklebust
@ 2002-06-25 23:20 ` Phil Oester
  2002-06-26  0:23   ` Marcelo Tosatti
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Oester @ 2002-06-25 23:20 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Marcelo Tosatti, Linux Kernel

Thank you!!!  

Ever since moving to 2.4.19-pre9 we've noticed an incredible jump in GETATTR calls on our NFS server.  Will look forward to this making it into 2.4.19 release.

-Phil

On Tue, Jun 25, 2002 at 09:15:54PM +0200, Trond Myklebust wrote:
> 
>   Fixes an obvious bug in __nfs_refresh_inode(): after updating the
> attribute cache, if we discover that the data cache is invalid don't
> call nfs_zap_caches() as that will also reinvalidate the attribute
> cache.
>   This bug plays havoc with the new lookup/revalidation code in 2.4.19
> since it forces a lot of unnecessary extra GETATTR RPC calls.
> 
> Cheers,
>    Trond

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

* Re: [PATCH] 2.4.19-rc1 Fix NFS attribute caching bug
  2002-06-25 23:20 ` Phil Oester
@ 2002-06-26  0:23   ` Marcelo Tosatti
  0 siblings, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2002-06-26  0:23 UTC (permalink / raw)
  To: Phil Oester; +Cc: Trond Myklebust, Linux Kernel



On Tue, 25 Jun 2002, Phil Oester wrote:

> Thank you!!!
>
> Ever since moving to 2.4.19-pre9 we've noticed an incredible jump in
> GETATTR calls on our NFS server.  Will look forward to this making it
> into 2.4.19 release.

Its already in. ;)


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

end of thread, other threads:[~2002-06-26  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-25 19:15 [PATCH] 2.4.19-rc1 Fix NFS attribute caching bug Trond Myklebust
2002-06-25 23:20 ` Phil Oester
2002-06-26  0:23   ` Marcelo Tosatti

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

all inboxes | Powered by JetHome®