Coda File System

important bugfix for NetBSD-current coda support

From: Greg Troxel <>
Date: Wed, 15 Mar 2006 09:44:05 -0500
I just fixed some problems in NetBSD-current's coda kernel support.

If you are running -current, make sure you have at least revision 1.20
of src/sys/coda/coda_venus.c.

Some of this was fallout from use of struct lwp instead of struct
proc, but the readlink bug was just a bug and longstanding.

Anyone running non-current NetBSD and probably FreeBSD and OpenBSD
should probably read this diff and see about the coda_readlink fix.
Basically, the code adds CODA_MAXPATHLEN to Osize, but this must be
done before the buffer is allocated (with "ALLOC") so that there is
allocated memory for venus to write to.  (I'd appreciate a clean patch
for that against netbsd-3 and test results - then I can submit a
pullup request.)

On the subject of kernel support - how do people feel about pre-realm
support?  I'm inclined to rip it out of NetBSD-current - on the theory
that the number of people who want to run NetBSD-current and Coda 5 is
surely zero.  Thoughts?

From: Greg Troxel <>
Subject: CVS commit: src/sys/coda
Message-Id: <>
Date: Wed, 15 Mar 2006 14:30:56 +0000 (UTC)

Module Name:	src
Committed By:	gdt
Date:		Wed Mar 15 14:30:56 UTC 2006

Modified Files:
	src/sys/coda: coda_venus.c

Log Message:
Add comments explaining how the 3 size variables for venus calls are

Remove defect in size allocation for coda_readlink to avoid having
venus write outside malloced space by including pathname space before

Add asserts that cred structure is non-NULL and non-FSCRED.

Check lwp against NULL before dereferencing it.

Assert that output pointer is non-NULL on a few venus returns.  This "can't
happen" but has been seen in crash dumps.

With these changes, the following work on a 345 MB coda volume.
(Before, a single invocation of tar or pax on this volume would

$ for i in $(seq 1 10); do find . -type f -print0 |xargs -0 md5 > MD5.$i & done

Two copies of

$ for i in $(seq 1 10); do pax -w /coda/[redacted] >/dev/null & done

(lwp NULL check semi-reviewed by wrstuden@)

To generate a diff of this commit:
cvs rdiff -r1.19 -r1.20 src/sys/coda/coda_venus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Received on 2006-03-15 09:48:37