svn commit: r270973 - head/sys/dev/mrsas
Kashyap D Desai
kadesai at FreeBSD.org
Tue Sep 2 18:32:42 UTC 2014
Author: kadesai
Date: Tue Sep 2 18:32:41 2014
New Revision: 270973
URL: http://svnweb.freebsd.org/changeset/base/270973
Log:
Fix for WITNESS warning while doing xpt_rescan.
This happen when converting any JBOD to RAID or creating
any new RAID from Unconfigured Drives.
Without this fix, user may see below call trace if WITNESS is enabled.
witness_warn() at witness_warn+0x4b5/frame 0xfffffe011f929a00
uma_zalloc_arg() at uma_zalloc_arg+0x3b/frame 0xfffffe011f929a70
malloc() at malloc+0x192/frame 0xfffffe011f929ac0
mrsas_bus_scan_sim() at mrsas_bus_scan_sim+0x32/frame 0xfffffe011f929af0
mrsas_aen_handler() at mrsas_aen_handler+0x11c/frame 0xfffffe011f929b20
taskqueue_run_locked() at taskqueue_run_locked+0xf0/frame 0xfffffe011f929b80
taskqueue_thread_loop() at taskqueue_thread_loop+0x9b/frame 0xfffffe011f929bb0
fork_exit() at fork_exit+0x84/frame 0xfffffe011f929bf0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe011f929bf0
Submitted by: kadesai
Reviewed by: ambrisko
MFC after: 3 days
Modified:
head/sys/dev/mrsas/mrsas.h
head/sys/dev/mrsas/mrsas_cam.c
Modified: head/sys/dev/mrsas/mrsas.h
==============================================================================
--- head/sys/dev/mrsas/mrsas.h Tue Sep 2 18:21:19 2014 (r270972)
+++ head/sys/dev/mrsas/mrsas.h Tue Sep 2 18:32:41 2014 (r270973)
@@ -101,7 +101,7 @@ __FBSDID("$FreeBSD$");
*/
#define BYTE_ALIGNMENT 1
#define MRSAS_MAX_NAME_LENGTH 32
-#define MRSAS_VERSION "06.704.01.00-fbsd"
+#define MRSAS_VERSION "06.704.01.01-fbsd"
#define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF
#define MRSAS_DEFAULT_TIMEOUT 0x14 //temp
#define DONE 0
Modified: head/sys/dev/mrsas/mrsas_cam.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_cam.c Tue Sep 2 18:21:19 2014 (r270972)
+++ head/sys/dev/mrsas/mrsas_cam.c Tue Sep 2 18:32:41 2014 (r270973)
@@ -1116,18 +1116,16 @@ int mrsas_bus_scan(struct mrsas_softc *s
union ccb *ccb_0;
union ccb *ccb_1;
- mtx_lock(&sc->sim_lock);
if ((ccb_0 = xpt_alloc_ccb()) == NULL) {
- mtx_unlock(&sc->sim_lock);
return(ENOMEM);
}
if ((ccb_1 = xpt_alloc_ccb()) == NULL) {
xpt_free_ccb(ccb_0);
- mtx_unlock(&sc->sim_lock);
return(ENOMEM);
}
+ mtx_lock(&sc->sim_lock);
if (xpt_create_path(&ccb_0->ccb_h.path, xpt_periph, cam_sim_path(sc->sim_0),
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP){
xpt_free_ccb(ccb_0);
@@ -1144,9 +1142,9 @@ int mrsas_bus_scan(struct mrsas_softc *s
return(EIO);
}
+ mtx_unlock(&sc->sim_lock);
xpt_rescan(ccb_0);
xpt_rescan(ccb_1);
- mtx_unlock(&sc->sim_lock);
return(0);
}
@@ -1161,19 +1159,18 @@ int mrsas_bus_scan_sim(struct mrsas_soft
{
union ccb *ccb;
- mtx_lock(&sc->sim_lock);
if ((ccb = xpt_alloc_ccb()) == NULL) {
- mtx_unlock(&sc->sim_lock);
return(ENOMEM);
}
+ mtx_lock(&sc->sim_lock);
if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim),
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP){
xpt_free_ccb(ccb);
mtx_unlock(&sc->sim_lock);
return(EIO);
}
- xpt_rescan(ccb);
mtx_unlock(&sc->sim_lock);
+ xpt_rescan(ccb);
return(0);
}
More information about the svn-src-all
mailing list