Page MenuHomeFreeBSD

D48688.diff
No OneTemporary

D48688.diff

diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -1803,10 +1803,17 @@
(softc->quirks & DA_Q_NO_PREVENT) == 0)
daprevent(periph, PR_PREVENT);
- if (error == 0) {
+ /*
+ * Only 'validate' the pack if the media size is non-zero and the
+ * underlying peripheral isn't invalid (the only error != 0 path).
+ */
+ if (error == 0 && softc->params.sectors != 0)
softc->flags &= ~DA_FLAG_PACK_INVALID;
+ else
+ softc->flags |= DA_FLAG_PACK_INVALID;
+
+ if (error == 0)
softc->flags |= DA_FLAG_OPEN;
- }
da_periph_unhold(periph, DA_REF_OPEN_HOLD);
cam_periph_unlock(periph);

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 16, 9:48 PM (6 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28790798
Default Alt Text
D48688.diff (666 B)

Event Timeline