diff options
| author | Scott Long <scottl@FreeBSD.org> | 2009-03-01 16:31:35 +0000 |
|---|---|---|
| committer | Scott Long <scottl@FreeBSD.org> | 2009-03-01 16:31:35 +0000 |
| commit | 2390a1b216495ee1146d088cf17c5f156caa8489 (patch) | |
| tree | c1fd87ec12873000654cff85724b9c1b814fa184 /sys | |
| parent | a3a749d08a7366a864da235f377169c2c10b199b (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/cam/scsi/scsi_da.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 67797019e3ae..7fa62189ba76 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -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); } |
