Various FreeBSD Coda fixes

Robert Watson rwatson at FreeBSD.org
Sat Jan 19 09:14:17 PST 2008


Rune, Jan,

Well, I got very slightly carried away, and I believe I've fixed a number of 
the problems being reported:

- I applied the nullfs-style VM object sharing to Coda, which seems to get
   binaries working, although as I mentioned I do have some reservations.
- I hooked up a null printer for vop_print rather than panic so locking
   problems can be debugged more easily.
- I fixed several vnode locking related problems, including failing to acquire
   the vnode lock before returning from mkdir, lock recursion leading to a
   panic on unmount, etc.
- I fixed statfs so it displays something a bit more sensible.

I'm not sure if these can be MFC'd before 7.0, but will ask re@ if we can fit 
them in.  Certainly, it's better than panicking, which is a relatively likely 
scenario with what's currently in RELENG_7.

The only remaining problem I'm aware of is that the Coda module leaks memory 
when unloaded, presumably because the unload routine doesn't actually do any 
cleanup.  I've not investigated further as yet, but this is somewhat more edge 
case than the other problems.

Robert N M Watson
Computer Laboratory
University of Cambridge

---------- Forwarded message ----------
Date: Sat, 19 Jan 2008 13:27:14 +0000 (UTC)
From: Robert Watson <rwatson at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org, cvs-all at FreeBSD.org
Subject: cvs commit: src/sys/fs/coda coda_vnops.c

rwatson     2008-01-19 13:27:14 UTC

   FreeBSD src repository

   Modified files:
     sys/fs/coda          coda_vnops.c
   Log:
   Borrow the VM object associated with an underlying cache vnode with the
   Coda vnode derived from it, in the style of nullfs.  This allows files
   in the Coda file system to be memory-mapped, such as with execve(2) or
   mmap(2).

   MFC after:      3 days
   Reported by:    Rune <u+openafsdev-sr55 at chalmers dot se>

   Revision  Changes    Path
   1.79      +5 -1      src/sys/fs/coda/coda_vnops.c



---------- Forwarded message ----------
Date: Sat, 19 Jan 2008 13:29:14 +0000 (UTC)
From: Robert Watson <rwatson at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org, cvs-all at FreeBSD.org
Subject: cvs commit: src/sys/fs/coda coda_vnops.c

rwatson     2008-01-19 13:29:14 UTC

   FreeBSD src repository

   Modified files:
     sys/fs/coda          coda_vnops.c
   Log:
   Lock the new directory vnode returned by coda_mkdir(), as this is required
   by FreeBSD's vnode locking protocol.

   MFC after:      3 days

   Revision  Changes    Path
   1.80      +5 -1      src/sys/fs/coda/coda_vnops.c



---------- Forwarded message ----------
Date: Sat, 19 Jan 2008 13:41:56 +0000 (UTC)
From: Robert Watson <rwatson at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org, cvs-all at FreeBSD.org
Subject: cvs commit: src/sys/fs/coda coda_vnops.c

rwatson     2008-01-19 13:41:56 UTC

   FreeBSD src repository

   Modified files:
     sys/fs/coda          coda_vnops.c
   Log:
   Use VOP_NULL rather than VOP_PANIC for Coda's vop_print routine, so as
   to avoid panicking in DDB show lockedvnods.

   MFC after:      3 days

   Revision  Changes    Path
   1.81      +1 -1      src/sys/fs/coda/coda_vnops.c



---------- Forwarded message ----------
Date: Sat, 19 Jan 2008 14:32:44 +0000 (UTC)
From: Robert Watson <rwatson at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org, cvs-all at FreeBSD.org
Subject: cvs commit: src/sys/fs/coda cnode.h coda_namecache.h coda_psdev.c
        coda_vfsops.c

rwatson     2008-01-19 14:32:44 UTC

   FreeBSD src repository

   Modified files:
     sys/fs/coda          cnode.h coda_namecache.h coda_psdev.c
                          coda_vfsops.c
   Log:
   Don't declare functions as extern.

   Move all extern variable definitions to associated .h files, move some
   extern variable definitions between include files to place them more
   appropriately.

   MFC after:      3 days

   Revision  Changes    Path
   1.22      +0 -6      src/sys/fs/coda/cnode.h
   1.12      +22 -15    src/sys/fs/coda/coda_namecache.h
   1.40      +0 -3      src/sys/fs/coda/coda_psdev.c
   1.70      +0 -3      src/sys/fs/coda/coda_vfsops.c



---------- Forwarded message ----------
Date: Sat, 19 Jan 2008 15:39:10 +0000 (UTC)
From: Robert Watson <rwatson at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org, cvs-all at FreeBSD.org
Subject: cvs commit: src/sys/fs/coda coda_vnops.c

rwatson     2008-01-19 15:39:10 UTC

   FreeBSD src repository

   Modified files:
     sys/fs/coda          coda_vnops.c
   Log:
   Don't acquire an additional vnode reference to a vnode when it is opened
   and then release it when it is closed: we rely on the caller to keep the
   vnode around with a valid reference.  This avoids vrele() destroying the
   vnode vop_close() is being called from during a call to vop_close(), and
   a crash due to lockmgr recursing the vnode lock when a Coda unmount
   occurs.

   MFC after:      3 days

   Revision  Changes    Path
   1.82      +0 -5      src/sys/fs/coda/coda_vnops.c



---------- Forwarded message ----------
Date: Sat, 19 Jan 2008 15:40:46 +0000 (UTC)
From: Robert Watson <rwatson at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org, cvs-all at FreeBSD.org
Subject: cvs commit: src/sys/fs/coda coda_vfsops.c

rwatson     2008-01-19 15:40:46 UTC

   FreeBSD src repository

   Modified files:
     sys/fs/coda          coda_vfsops.c
   Log:
   Zero mi_rotovp and coda_ctlvp immediately after calling vrele() on the
   vnodes during coda_unmount() in order to detect errant use of them
   after the vnode references may no longer be valid.

   No need to clear the VV_ROOT flag on mi_rootvp flag (especially after
   the vnode reference is no longer valid) as this isn't done on other
   file systems.

   MFC after:      3 days

   Revision  Changes    Path
   1.71      +2 -3      src/sys/fs/coda/coda_vfsops.c



---------- Forwarded message ----------
Date: Sat, 19 Jan 2008 16:39:14 +0000 (UTC)
From: Robert Watson <rwatson at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org, cvs-all at FreeBSD.org
Subject: cvs commit: src/sys/fs/coda coda_vfsops.c

rwatson     2008-01-19 16:39:14 UTC

   FreeBSD src repository

   Modified files:
     sys/fs/coda          coda_vfsops.c
   Log:
   Rework coda_statfs(): no longer need to zero the statfs structure or
   fill out all fields, just fill out the ones the file system knows
   about.  Among other things, this causes the outpuf of "mount" and
   "df" to make quite a bit more sense as /dev/cfs0 is specified as the
   mountfrom name.

   MFC after:      3 days

   Revision  Changes    Path
   1.72      +1 -6      src/sys/fs/coda/coda_vfsops.c


More information about the freebsd-fs mailing list