All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Access cache forgetting mode bits
@ 2003-08-28 16:39 Steve Dickson
  2003-08-28 21:51 ` Andreas Gruenbacher
  0 siblings, 1 reply; 8+ messages in thread
From: Steve Dickson @ 2003-08-28 16:39 UTC (permalink / raw)
  To: nfs

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

While debugging something else, I notice that every time
I did a ls on a nfs mounted directory a wto ACCESS rpc was
*always* happening (with a  2.4.21 kernel). Taking a closer
look it turns out the access cache  was dropping previous
access bits. Here is the scenario...

nfs_permission is called with mode = MAY_EXEC
the cached value is Zero so an ACCESS rpc is done.
after the rpc, the cached value is _set_ to MAY_EXEC

then nfs_permission is called with mode = MAY_READ
the cached value is MAY_EXEC, so an ACCESS rpc is done.
after the rpc, the cache value is _set_ to MAY_READ

again, nfs_permission is called with mode = MAY_EXEC
this time the cached value is MAY_READ so _again_ an RPC is done
after the rpc, the cached value is _set_ to MAY_EXEC

Its a vicious cycle...

So this patch changes the setting of the masked value
to the or-ing of the masked value. This cause the
previous bits to be remembered thus cutting down on
the number of otw rpcs...


SteveD.

[-- Attachment #2: linux-2.4.21-nfs-accesscache.patch --]
[-- Type: text/plain, Size: 364 bytes --]

--- linux-2.4.21/fs/nfs/dir.c.diff	2003-08-28 12:13:22.000000000 -0400
+++ linux-2.4.21/fs/nfs/dir.c	2003-08-28 12:13:47.000000000 -0400
@@ -1278,7 +1278,7 @@ nfs_permission(struct inode *inode, int 
 		if (cache->cred)
 			put_rpccred(cache->cred);
 		cache->cred = cred;
-		cache->mask = mask;
+		cache->mask |= mask;
 		cache->err = error;
 		return error;
 	}

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

end of thread, other threads:[~2003-09-01 13:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-28 16:39 [PATCH] Access cache forgetting mode bits Steve Dickson
2003-08-28 21:51 ` Andreas Gruenbacher
2003-08-29 13:14   ` Steve Dickson
2003-08-31 20:33   ` Steve Dickson
2003-08-31 23:25     ` Andreas Gruenbacher
2003-09-01  3:22       ` Steve Dickson
2003-09-01  3:52         ` Trond Myklebust
2003-09-01 13:13           ` Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.