[Bug 226578] panic: _mtx_lock_sleep: recursed on non-recursive mutex CAM device lock @ /usr/home/trasz/svn-ssh/head/sys/cam/scsi/scsi_da.c:2042

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Mar 13 17:38:17 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226578

Warner Losh <imp at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |imp at FreeBSD.org

--- Comment #1 from Warner Losh <imp at FreeBSD.org> ---
OK. XPT is locking the periph lock in xpt_async_process_dev sometimes, but not
other times. The following only takes out the lock when we're likely to change
the flags. It's an OK workaround for the moment, if it works, so we can
validate the funky locking done in xpt_async_process_dev() and stylize the test
a bit better...



diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index f5be34f96e0..90045ca3e76 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -2039,10 +2039,10 @@ daasync(void *callback_arg, u_int32_t code,
                 * Handle all UNIT ATTENTIONs except our own,
                 * as they will be handled by daerror().
                 */
-               cam_periph_lock(periph);
                if (xpt_path_periph(ccb->ccb_h.path) != periph &&
                    scsi_extract_sense_ccb(ccb,
                     &error_code, &sense_key, &asc, &ascq)) {
+                       cam_periph_lock(periph);
                        if (asc == 0x2A && ascq == 0x09) {
                                xpt_print(ccb->ccb_h.path,
                                    "Capacity data has changed\n");
@@ -2057,8 +2057,8 @@ daasync(void *callback_arg, u_int32_t code,
                                softc->flags &= ~DA_FLAG_PROBED;
                                dareprobe(periph);
                        }
+                       cam_periph_unlock(periph);
                }
-               cam_periph_unlock(periph);
                break;
        }
        case AC_SCSI_AEN:

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list