From 22d3bb2625f587b9d09a8cfb4228a7e760a3344e Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sat, 9 Dec 2017 15:34:40 +0000 Subject: [PATCH] Move the DIAGNOSTIC check for lost iSCSI PDUs from icl_conn_close() to icl_conn_free(). It's perfectly valid for the counter to be non-zero in the former. MFC after: 2 weeks Sponsored by: playkey.net --- sys/dev/iscsi/icl_soft.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 5f8a8004d4d3..b0628baef4f9 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -1170,6 +1170,11 @@ void icl_soft_conn_free(struct icl_conn *ic) { +#ifdef DIAGNOSTIC + KASSERT(ic->ic_outstanding_pdus == 0, + ("destroying session with %d outstanding PDUs", + ic->ic_outstanding_pdus)); +#endif cv_destroy(&ic->ic_send_cv); cv_destroy(&ic->ic_receive_cv); kobj_delete((struct kobj *)ic, M_ICL_SOFT); @@ -1410,11 +1415,6 @@ icl_soft_conn_close(struct icl_conn *ic) KASSERT(STAILQ_EMPTY(&ic->ic_to_send), ("destroying session with non-empty send queue")); -#ifdef DIAGNOSTIC - KASSERT(ic->ic_outstanding_pdus == 0, - ("destroying session with %d outstanding PDUs", - ic->ic_outstanding_pdus)); -#endif ICL_CONN_UNLOCK(ic); }