1 Jan 1998 23:38
NFS server cache bug
<rick <at> snowhite.cis.uoguelph.ca>
1998-01-01 22:38:51 GMT
1998-01-01 22:38:51 GMT
I have no idea if this race condition problem still lives in any of the current source code trees, but I bumped into it when testing V4 and thought I'd let you know. The basic problem is that nfsrv_getcache() does either a malloc or gets the lru entry (with a potential to sleep in both cases). While sleeping, it is possible for a retried copy of the same request to get into the cache, resulting in duplicates and potential problems later. My code base is now quite different, but I think the following fixes the problem. Basically, move the malloc to the top, before the search loop and change the "else" case to look for an unlocked entry without sleeping and fall back on using the newly malloc'd one, avoiding any sleeps after the search loop. Here is a "diff -c" for the nfs_srvcache.c that was in OpenBSD 2.6. (If the entire file is more useful, you can get it via anonymous ftp to snowhite.cis.uoguelph.ca in pub/nfs/nfs_srvcache.c.fixed.) In case you are wondering, the V4 server did ok at the recent bakeoff (although it still is missing some capabilities and needs more work) and the CITI folks at the Univ. of Michigan are working on the client. (I'll be putting an updated tarball on the ftp site soon, but unless you are really keen, it might be better to wait until the code is merged with the Univ. of Michigan work.) Good luck with it, rick --- diff -c nfs_srvcache.c --- *** nfs_srvcache.c.sav Fri Aug 9 22:20:43 2002(Continue reading)
RSS Feed