Coda File System

Re: codasrv crash on netbsd/sparc64 3.0

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Tue, 25 Apr 2006 17:58:19 -0400
On Tue, Apr 25, 2006 at 04:38:02PM -0400, Greg Troxel wrote:
> NetBSD says to use MAP_FAILED, and to include sys/mman.h, which
> contains:
> 
> #define	MAP_FAILED	((void *) -1)	/* mmap() failed */

Strange that is exactly what we use. The only place that mmaps in rwcdb
is rwcdb_file.c:file_mread. And that file includes <sys/mman.h> and even
defines MAP_FAILED the same way if it happens to be missing.

Then the mmap return is checked against MAP_FAILED in which case we set
f->map to NULL to make us fall back on the 'read into allocated memory
buffer' code.

I actually wonder how much the mmap buys us here, we clearly have the
potential for unaligned accesses and solving that will require the extra
memory copy. Reading into the pre-allocated buffer will always be
aligned.

Also the pdb database is really only accessed when a new RPC2 connection
is set up. We get the sorted list of all groups a user is a member of at
that time and associate the list with the connection. After that when we
need to check a directory ACL it is compared against the cached list.

Jan
Received on 2006-04-25 17:59:48