Fix spurious panic when twice remounting a bad filingsystem. It then gets

the same memory block allocated as before and it bombs out on its
descriptor pool allready being initialised. It turns out that the pool was
not allways destroyed. This fix ought to clean it up whatever the cause of
the mishap that results in a reject.
This commit is contained in:
reinoud 2006-08-21 22:23:09 +00:00
parent 413b7762c2
commit 445a215f26
1 changed files with 6 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_vfsops.c,v 1.9 2006/08/10 12:39:56 reinoud Exp $ */
/* $NetBSD: udf_vfsops.c,v 1.10 2006/08/21 22:23:09 reinoud Exp $ */
/*
* Copyright (c) 2006 Reinoud Zandijk
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: udf_vfsops.c,v 1.9 2006/08/10 12:39:56 reinoud Exp $");
__RCSID("$NetBSD: udf_vfsops.c,v 1.10 2006/08/21 22:23:09 reinoud Exp $");
#endif /* not lint */
@ -213,6 +213,10 @@ free_udf_mountinfo(struct mount *mp)
ump = VFSTOUDF(mp);
if (ump) {
/* dispose of our descriptor pool */
pool_destroy(&ump->desc_pool);
/* clear our data */
mp->mnt_data = NULL;
for (i = 0; i < UDF_ANCHORS; i++)
MPFREE(ump->anchors[i], M_UDFVOLD);
@ -227,11 +231,6 @@ free_udf_mountinfo(struct mount *mp)
MPFREE(ump->vat_table, M_UDFVOLD);
MPFREE(ump->sparing_table, M_UDFVOLD);
/*
* Note that the node related (e)fe descriptors pool is
* destroyed already if it was used.
*/
free(ump, M_UDFMNT);
}
}
@ -433,9 +432,6 @@ udf_unmount(struct mount *mp, int mntflags, struct lwp *l)
* VOP_RECLAIM on the nodes themselves.
*/
/* dispose of our descriptor pool */
pool_destroy(&ump->desc_pool);
/* close device */
DPRINTF(VOLUMES, ("closing device\n"));
if (mp->mnt_flag & MNT_RDONLY) {