Fix a panic which (reportedly) can happen when unmounting a filesystem

with I/O requests in flight on kernels compiled with "options INVARIANTS".
Also, make it obvious it's not right to call g_valid_obj() (and macros
using it, e.g. G_VALID_CONSUMER()) without topology lock held.

Approved by:	re (kib)
Reported by:	pho
This commit is contained in:
Edward Tomasz Napierala 2009-07-01 20:16:29 +00:00
parent f981547c99
commit 8edfe76ab5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195257
2 changed files with 3 additions and 1 deletions

View File

@ -1025,6 +1025,8 @@ g_valid_obj(void const *ptr)
struct g_consumer *cp;
struct g_provider *pp;
g_topology_assert();
LIST_FOREACH(mp, &g_classes, class) {
if (ptr == mp)
return (1);

View File

@ -106,7 +106,7 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp)
int vfslocked;
cp = bo->bo_private;
G_VALID_CONSUMER(cp);
/* G_VALID_CONSUMER(cp); We likely lack topology lock */
/*
* If the the provider has orphaned us, just return EXIO.