Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 2014 17:52:22 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r264511 - stable/9/sys/dev/ciss
Message-ID:  <201404151752.s3FHqMmC055648@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Tue Apr 15 17:52:22 2014
New Revision: 264511
URL: http://svnweb.freebsd.org/changeset/base/264511

Log:
  MFC r264354 but change the lock arg and implementation to fit the current state
  of CAM in stable/9
  
  Fix insta-panic on assert of unlocked periph mtx in ciss(4) when
  logical volume state changes.
  
  I'm still setting the mergeinfo as done here as the intent of the MFC, if not
  the EXACT code is being implemented.
  
  Reviewed by:	mav@
  Sponsored by:	Yahoo! Inc

Modified:
  stable/9/sys/dev/ciss/ciss.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ciss/ciss.c
==============================================================================
--- stable/9/sys/dev/ciss/ciss.c	Tue Apr 15 17:49:47 2014	(r264510)
+++ stable/9/sys/dev/ciss/ciss.c	Tue Apr 15 17:52:22 2014	(r264511)
@@ -180,8 +180,6 @@ static int	ciss_cam_emulate(struct ciss_
 static void	ciss_cam_poll(struct cam_sim *sim);
 static void	ciss_cam_complete(struct ciss_request *cr);
 static void	ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio);
-static struct cam_periph *ciss_find_periph(struct ciss_softc *sc,
-					   int bus, int target);
 static int	ciss_name_device(struct ciss_softc *sc, int bus, int target);
 
 /* periodic status monitoring */
@@ -3398,27 +3396,6 @@ ciss_cam_complete_fixup(struct ciss_soft
 
 
 /********************************************************************************
- * Find a peripheral attached at (target)
- */
-static struct cam_periph *
-ciss_find_periph(struct ciss_softc *sc, int bus, int target)
-{
-    struct cam_periph	*periph;
-    struct cam_path	*path;
-    int			status;
-
-    status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]),
-			     target, 0);
-    if (status == CAM_REQ_CMP) {
-	periph = cam_periph_find(path, NULL);
-	xpt_free_path(path);
-    } else {
-	periph = NULL;
-    }
-    return(periph);
-}
-
-/********************************************************************************
  * Name the device at (target)
  *
  * XXX is this strictly correct?
@@ -3427,12 +3404,22 @@ static int
 ciss_name_device(struct ciss_softc *sc, int bus, int target)
 {
     struct cam_periph	*periph;
+    struct cam_path	*path;
+    int			status;
 
     if (CISS_IS_PHYSICAL(bus))
 	return (0);
-    if ((periph = ciss_find_periph(sc, bus, target)) != NULL) {
+
+    status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]),
+			     target, 0);
+
+    if (status == CAM_REQ_CMP) {
+    	mtx_lock(&sc->ciss_mtx);
+	periph = cam_periph_find(path, NULL);
 	sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d",
 		periph->periph_name, periph->unit_number);
+    	mtx_unlock(&sc->ciss_mtx);
+	xpt_free_path(path);
 	return(0);
     }
     sc->ciss_logical[bus][target].cl_name[0] = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404151752.s3FHqMmC055648>