Module Name:    src
Committed By:   mlelstv
Date:           Sat Apr  8 13:50:23 UTC 2017

Modified Files:
        src/sys/dev/scsipi: cd.c

Log Message:
ignore a failed scspi_prevent when accessing the RAW_PART as before.


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/sys/dev/scsipi/cd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.339 src/sys/dev/scsipi/cd.c:1.340
--- src/sys/dev/scsipi/cd.c:1.339	Thu Jan  5 16:35:33 2017
+++ src/sys/dev/scsipi/cd.c	Sat Apr  8 13:50:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.339 2017/01/05 16:35:33 mlelstv Exp $	*/
+/*	$NetBSD: cd.c,v 1.340 2017/04/08 13:50:23 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.339 2017/01/05 16:35:33 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.340 2017/04/08 13:50:23 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -428,8 +428,11 @@ cd_firstopen(device_t self, dev_t dev, i
 	    XS_CTL_IGNORE_MEDIA_CHANGE);
 	SC_DEBUG(periph, SCSIPI_DB1,
 	    ("cdopen: scsipi_prevent, error=%d\n", error));
-	if (error)
+	if (error) {
+		if (part == RAW_PART)
+			goto out;
 		goto bad;
+	}
 
 	if ((periph->periph_flags & PERIPH_MEDIA_LOADED) == 0) {
 		int param_error;
@@ -448,6 +451,8 @@ cd_firstopen(device_t self, dev_t dev, i
 	}
 
 	periph->periph_flags |= PERIPH_OPEN;
+
+out:
 	return 0;
 
 bad2:
@@ -459,7 +464,6 @@ bad2:
 bad:
 	scsipi_adapter_delref(adapt);
 	return error;
-
 }
 
 /*

Reply via email to