All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] DefineSimpleCache macro problem
@ 2004-05-13  8:22 Olaf Kirch
  2004-05-13  9:36 ` Neil Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Olaf Kirch @ 2004-05-13  8:22 UTC (permalink / raw)
  To: nfs

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

Hi,

the 2.6 code has this new cache stuff to create caches for various
things, which is used for the export table and ip client list.

I came across a strange problem where a host exported several directories
to a group of clients, but clients were unable to mount more than one.

It turned out that the problem was caused by svc_export_lookup, which
will create bogus entries even if called in lookup-only mode.  This caused
bogus export entries to be created, which didn't have the VALID flag set.

Essentially, the macro-defined function in sunrpc/cache.h will always
create entries in the cache, even if "set == 0". The attached patch
fixes this, and changes the lookup functions to return NULL in this
case, rather than a bogus entry.

However, this change uncovered another problem. AIX clients will
do a NULL procedure call before attempting the mount (I think this
is a known issue). If the file system is exported to a wildcard
group, the kernel will not know about the client when this call
arrives.

Previously, this would always succeed, because the ip_map_lookup() call
from svcauth_unix_accept() would always return an entry, even if it was
a bogus one. With the change to cache.h, ip_map_lookup() will now return
NULL for unknown clients, causing the NULL call from the AIX client
to be dropped. The second patch attached below will fix this issue
as well.

Cheers
Olaf
-- 
Olaf Kirch     |  The Hardware Gods hate me.
okir@suse.de   |
---------------+ 

[-- Attachment #2: sunrpc-bogus-export-entry --]
[-- Type: text/plain, Size: 489 bytes --]

--- linux-2.6.5/include/linux/sunrpc/cache.h.bug	2004-03-12 12:17:26.000000000 +0100
+++ linux-2.6.5/include/linux/sunrpc/cache.h	2004-05-10 13:19:58.000000000 +0200
@@ -223,7 +223,7 @@
 	else read_unlock(&(DETAIL)->hash_lock);						\
 	if (new && set)									\
 		cache_fresh(DETAIL, &new->MEMBER, item->MEMBER.expiry_time);		\
-	if (new)				       					\
+	if (new || !set)			       					\
 		return new;								\
 	new = kmalloc(sizeof(*new), GFP_KERNEL);					\
 	if (new) {									\

[-- Attachment #3: sunrpc-null-noauth --]
[-- Type: text/plain, Size: 567 bytes --]

--- linux-2.6.5/net/sunrpc/svcauth_unix.c.aix	2004-05-12 21:40:41.000000000 +0200
+++ linux-2.6.5/net/sunrpc/svcauth_unix.c	2004-05-13 10:05:38.000000000 +0200
@@ -390,7 +390,13 @@
 			break;
 		default: BUG();
 		}
-	else rv = SVC_DROP;
+	else if (rqstp->rq_proc == 0) {
+		/* We always accept calls to NULL. AIX clients try
+		   a NULL call before mounting, so when we get here
+		   we may not know about the export entry yet. */
+		rv = SVC_OK;
+	} else
+		rv = SVC_DROP;
 
 	if (rqstp->rq_client == NULL && rqstp->rq_proc != 0)
 		*authp = rpc_autherr_badcred;

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

end of thread, other threads:[~2004-05-14  1:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-13  8:22 [PATCH] DefineSimpleCache macro problem Olaf Kirch
2004-05-13  9:36 ` Neil Brown
2004-05-13 10:45   ` Olaf Kirch
2004-05-13 19:15     ` J. Bruce Fields
2004-05-14  1:20     ` Neil Brown

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.