Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Mar 2018 18:27:23 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 226510] panic: Re-refing for reason 5, cnt = 1
Message-ID:  <bug-226510-8-Xp62tYmc3V@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-226510-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-226510-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D226510

--- Comment #11 from Warner Losh <imp@FreeBSD.org> ---
Does this help?
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index c6941990a8df..4bcddbb8dff9 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -2039,26 +2039,30 @@ 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) !=3D periph &&
                    scsi_extract_sense_ccb(ccb,
                     &error_code, &sense_key, &asc, &ascq)) {
                        if (asc =3D=3D 0x2A && ascq =3D=3D 0x09) {
                                xpt_print(ccb->ccb_h.path,
                                    "Capacity data has changed\n");
+                               cam_periph_lock(periph);
                                softc->flags &=3D ~DA_FLAG_PROBED;
+                               cam_periph_unlock(periph);
                                dareprobe(periph);
                        } else if (asc =3D=3D 0x28 && ascq =3D=3D 0x00) {
+                               cam_periph_lock(periph);
                                softc->flags &=3D ~DA_FLAG_PROBED;
+                               cam_periph_unlock(periph);
                                disk_media_changed(softc->disk, M_NOWAIT);
                        } else if (asc =3D=3D 0x3F && ascq =3D=3D 0x03) {
                                xpt_print(ccb->ccb_h.path,
                                    "INQUIRY data has changed\n");
+                               cam_periph_lock(periph);
                                softc->flags &=3D ~DA_FLAG_PROBED;
+                               cam_periph_unlock(periph);
                                dareprobe(periph);
                        }
                }
-               cam_periph_unlock(periph);
                break;
        }
        case AC_SCSI_AEN:

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-226510-8-Xp62tYmc3V>