Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Mar 2009 16:31:35 +0000 (UTC)
From:      Scott Long <scottl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r189242 - in stable/7/sys: . cam/scsi contrib/pf dev/ath/ath_hal dev/cxgb
Message-ID:  <200903011631.n21GVZho048598@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scottl
Date: Sun Mar  1 16:31:35 2009
New Revision: 189242
URL: http://svn.freebsd.org/changeset/base/189242

Log:
  Merge 182433: Fix locking mistake in the da driver.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/cam/scsi/scsi_da.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/7/sys/cam/scsi/scsi_da.c	Sun Mar  1 16:28:17 2009	(r189241)
+++ stable/7/sys/cam/scsi/scsi_da.c	Sun Mar  1 16:31:35 2009	(r189242)
@@ -674,18 +674,19 @@ daopen(struct disk *dp)
 		softc->disk->d_fwheads = softc->params.heads;
 		softc->disk->d_devstat->block_size = softc->params.secsize;
 		softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE;
-	}
-	
-	if (error == 0) {
+
 		if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 &&
 		    (softc->quirks & DA_Q_NO_PREVENT) == 0)
 			daprevent(periph, PR_PREVENT);
-	} else {
+	} else
 		softc->flags &= ~DA_FLAG_OPEN;
-		cam_periph_release(periph);
-	}
+
 	cam_periph_unhold(periph);
 	cam_periph_unlock(periph);
+
+	if (error != 0) {
+		cam_periph_release(periph);
+	}
 	return (error);
 }
 



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