NFS Hangs ... NFS4ERR_DELAY (Solved)

J. Bruce Fields bfields at fieldses.org
Tue Dec 11 11:17:20 EST 2007


On Tue, Dec 11, 2007 at 10:34:29AM -0500, Norman Elton wrote:
> Bruce,
> 
> A little poking into idmapd has resolved the problem. I configured  
> idmapd to run with "-v" on the server, and found this error in the  
> system log:
> 
> nfsdcb: id '-2' too big!

OK, great, thanks for finding that (and sorry for not suspecting that
earlier).  I believe it should be fixed by the patch below, which is in
2.6.23.  (I can't remember if you said what kernel version you were on.)

> On my 64-bit machine, nfsnobody has the ID of 4294967294. This appears  
> to cause idmapd to choke and stop responding. I've changed it back to  
> the 32-bit version (65534) and things seem to be working as expected.

(That's actually 16-bit as opposed to 32-bit, but yeah, it has the
advantage that as a signed 32-bit integer it's positive....)

Anyway, you could also check whether the below fixes it.

Sounds like we also have a couple rpc.idmapd bugs--first, it should
probably be able to handle negative id's in the upcall somehow (even if
newer kernels are fixed not to use them), and second, it shouldn't be
ignoring all other upcalls after that.

--b.

commit 0a725fc4d3bfc4734164863d6c50208b109ca5c7
Author: J. Bruce Fields <bfields at citi.umich.edu>
Date:   Tue Jul 31 00:37:52 2007 -0700

    nfsd4: idmap upcalls should use unsigned uid and gid
    
    We shouldn't be using negative uid's and gid's in the idmap upcalls.
    
    Signed-off-by: "J. Bruce Fields" <bfields at citi.umich.edu>
    Cc: Neil Brown <neilb at suse.de>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>

diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index 2cf9a9a..2ccffde 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -138,7 +138,7 @@ idtoname_request(struct cache_detail *cd, struct cache_head *ch, char **bpp,
 	char idstr[11];
 
 	qword_add(bpp, blen, ent->authname);
-	snprintf(idstr, sizeof(idstr), "%d", ent->id);
+	snprintf(idstr, sizeof(idstr), "%u", ent->id);
 	qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user");
 	qword_add(bpp, blen, idstr);
 
@@ -165,7 +165,7 @@ idtoname_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h)
 		return 0;
 	}
 	ent = container_of(h, struct ent, h);
-	seq_printf(m, "%s %s %d", ent->authname,
+	seq_printf(m, "%s %s %u", ent->authname,
 			ent->type == IDMAP_TYPE_GROUP ? "group" : "user",
 			ent->id);
 	if (test_bit(CACHE_VALID, &h->flags))
@@ -349,7 +349,7 @@ nametoid_show(struct seq_file *m, struct cache_detail *cd, struct cache_head *h)
 			ent->type == IDMAP_TYPE_GROUP ? "group" : "user",
 			ent->name);
 	if (test_bit(CACHE_VALID, &h->flags))
-		seq_printf(m, " %d", ent->id);
+		seq_printf(m, " %u", ent->id);
 	seq_printf(m, "\n");
 	return 0;
 }


More information about the NFSv4 mailing list