summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-04-16 19:41:14 +0000
committerscottl <scottl@FreeBSD.org>2007-04-16 19:41:14 +0000
commit2cbe46fbfa2cd6c2c57c3e2d707e365829d31f72 (patch)
treeb9054d171039dfbd48a4b94b4c2a210dfec7d466 /sys
parent7d03d3285aae6413f443e68dab791abbd86a570f (diff)
downloadFreeBSD-src-2cbe46fbfa2cd6c2c57c3e2d707e365829d31f72.zip
FreeBSD-src-2cbe46fbfa2cd6c2c57c3e2d707e365829d31f72.tar.gz
Drop the periph/sim lock when calling disk_destroy().
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/scsi/scsi_cd.c2
-rw-r--r--sys/cam/scsi/scsi_da.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index fa85ada..fde3c25 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -486,7 +486,9 @@ cdcleanup(struct cam_periph *periph)
xpt_print(periph->path, "removing changer entry\n");
free(softc->changer, M_DEVBUF);
}
+ cam_periph_unlock(periph);
disk_destroy(softc->disk);
+ cam_periph_lock(periph);
free(softc, M_DEVBUF);
}
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index f799e44..558360b 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -939,13 +939,9 @@ dacleanup(struct cam_periph *periph)
&& sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
xpt_print(periph->path, "can't remove sysctl context\n");
}
- disk_destroy(softc->disk);
- /*
- * XXX Gotta drop the periph lock so that the drain can complete with
- * deadlocking on the lock. Hopefully dropping here is safe.
- */
cam_periph_unlock(periph);
+ disk_destroy(softc->disk);
callout_drain(&softc->sendordered_c);
cam_periph_lock(periph);
free(softc, M_DEVBUF);
OpenPOWER on IntegriCloud