panic: Most recently used by mount
Tim Robbins
tjr at freebsd.org
Sun Nov 9 15:33:22 PST 2003
On Sun, Nov 09, 2003 at 01:30:52PM -0800, Kris Kennaway wrote:
> On Sun, Nov 09, 2003 at 06:05:06PM +0100, Lukas Ertl wrote:
>
> > ---
> > panic: Most recently used by mount
>
> I reported this the other day..tjr has a fix in his p4 branch.
Here's the patch:
(http://perforce.freebsd.org/chv.cgi?CH=41739)
--- kern/vfs_mount.c.old Mon Nov 10 10:30:14 2003
+++ kern/vfs_mount.c Sun Nov 9 00:26:03 2003
@@ -700,6 +700,8 @@
mac_destroy_mount(mp);
#endif
crfree(mp->mnt_cred);
+ lockdestroy(&mp->mnt_lock);
+ mtx_destroy(&mp->mnt_mtx);
free(mp, M_MOUNT);
}
vrele(vp);
@@ -794,6 +796,8 @@
mac_destroy_mount(mp);
#endif
crfree(mp->mnt_cred);
+ lockdestroy(&mp->mnt_lock);
+ mtx_destroy(&mp->mnt_mtx);
free(mp, M_MOUNT);
vput(vp);
goto bad;
@@ -1066,6 +1070,8 @@
mac_destroy_mount(mp);
#endif
crfree(mp->mnt_cred);
+ lockdestroy(&mp->mnt_lock);
+ mtx_destroy(&mp->mnt_mtx);
free(mp, M_MOUNT);
}
vrele(vp);
@@ -1147,6 +1153,8 @@
mac_destroy_mount(mp);
#endif
crfree(mp->mnt_cred);
+ lockdestroy(&mp->mnt_lock);
+ mtx_destroy(&mp->mnt_mtx);
free(mp, M_MOUNT);
vput(vp);
}
@@ -1587,11 +1595,14 @@
free(path, M_MOUNT);
if (error != 0) {
if (mp != NULL) {
+ mp->mnt_vfc->vfc_refcount--;
vfs_unbusy(mp, curthread);
#ifdef MAC
mac_destroy_mount(mp);
#endif
crfree(mp->mnt_cred);
+ lockdestroy(&mp->mnt_lock);
+ mtx_destroy(&mp->mnt_mtx);
free(mp, M_MOUNT);
}
printf("Root mount failed: %d\n", error);
--- nfsclient/nfs_vfsops.c.old Mon Nov 10 10:31:08 2003
+++ nfsclient/nfs_vfsops.c Sun Nov 9 00:26:03 2003
@@ -510,8 +510,15 @@
printf("nfs_mountroot: mount %s on %s: %d", path, which, error);
mp->mnt_vfc->vfc_refcount--;
vfs_unbusy(mp, td);
- if (didalloc)
+ if (didalloc) {
+#ifdef MAC
+ mac_destroy_mount(mp);
+#endif
+ crfree(mp->mnt_cred);
+ lockdestroy(&mp->mnt_lock);
+ mtx_destroy(&mp->mnt_mtx);
free(mp, M_MOUNT);
+ }
FREE(nam, M_SONAME);
return (error);
}
More information about the freebsd-current
mailing list