Date: Sat, 14 Mar 2020 02:36:45 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358987 - head/sys/cam Message-ID: <202003140236.02E2ajF9076680@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sat Mar 14 02:36:45 2020 New Revision: 358987 URL: https://svnweb.freebsd.org/changeset/base/358987 Log: Add comment about how the deferred callback for AC_FOUND_DEVICE we generate for a race where a device goes away, we start to tear down the periph state for the device, and then the device suddently reappears. The key that makes it work is removal of periph from the drv list before calling the deferred callback. Hat tip to: mav@ Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sat Mar 14 02:24:11 2020 (r358986) +++ head/sys/cam/cam_periph.c Sat Mar 14 02:36:45 2020 (r358987) @@ -729,7 +729,9 @@ camperiphfree(struct cam_periph *periph) periph->periph_dtor(periph); /* - * The peripheral list is protected by the topology lock. + * The peripheral list is protected by the topology lock. We have to + * remove the periph from the drv list before we call deferred_ac. The + * AC_FOUND_DEVICE callback won't create a new periph if it's still there. */ xpt_lock_buses();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003140236.02E2ajF9076680>