From 3750f5ff897fbfb07e35b921d0d6e86aba623cec Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sat, 15 Feb 2020 18:14:23 +0000 Subject: [PATCH] The KASSERT is too strict: revert r357897 It's valid for a periph to be removed with outstanding transactions on the device. In CAM, multiple periphs attach to a single device. There's no interlock to prevent one of these going away while other periphs have outstanding CCBs and it's not an error either. Remove this overly agressive KASSERT to prevent false-positive panics when devices depart. --- sys/cam/cam_periph.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index f4855b819301..7d8f671eecd3 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* For KASSERTs only */ #include #include @@ -682,10 +681,6 @@ camperiphfree(struct cam_periph *periph) cam_periph_assert(periph, MA_OWNED); KASSERT(periph->periph_allocating == 0, ("%s%d: freed while allocating", periph->periph_name, periph->unit_number)); - KASSERT(periph->path->device->ccbq.dev_active == 0, - ("%s%d: freed with %d active CCBs\n", - periph->periph_name, periph->unit_number, - periph->path->device->ccbq.dev_active)); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0) break;