netdump: Fix netdumping with INVARIANTS kernels

Correct boneheaded assertion I added in r339501.  Mea culpa.

The intent is to notice when an M_WAITOK zone allocation would fail during
netdump, not to prevent all use of mbufs during netdump.

Reviewed by:	markj
X-MFC-With:	r339501
Differential Revision:	https://reviews.freebsd.org/D17957
This commit is contained in:
Conrad Meyer 2018-11-12 05:24:20 +00:00
parent 4a2f909992
commit 0d1467b199

View File

@ -410,8 +410,6 @@ nd_buf_import(void *arg, void **store, int count, int domain __unused,
struct mbuf *m; struct mbuf *m;
int i; int i;
KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__));
q = arg; q = arg;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
@ -421,6 +419,8 @@ nd_buf_import(void *arg, void **store, int count, int domain __unused,
trash_init(m, q == &nd_mbufq ? MSIZE : nd_clsize, flags); trash_init(m, q == &nd_mbufq ? MSIZE : nd_clsize, flags);
store[i] = m; store[i] = m;
} }
KASSERT((flags & M_WAITOK) == 0 || i == count,
("%s: ran out of pre-allocated mbufs", __func__));
return (i); return (i);
} }
@ -447,8 +447,6 @@ nd_pack_import(void *arg __unused, void **store, int count, int domain __unused,
void *clust; void *clust;
int i; int i;
KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__));
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
m = m_get(MT_DATA, M_NOWAIT); m = m_get(MT_DATA, M_NOWAIT);
if (m == NULL) if (m == NULL)
@ -461,6 +459,8 @@ nd_pack_import(void *arg __unused, void **store, int count, int domain __unused,
mb_ctor_clust(clust, nd_clsize, m, 0); mb_ctor_clust(clust, nd_clsize, m, 0);
store[i] = m; store[i] = m;
} }
KASSERT((flags & M_WAITOK) == 0 || i == count,
("%s: ran out of pre-allocated mbufs", __func__));
return (i); return (i);
} }