Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi ignore a failed scspi_prevent when accessing ...



details:   https://anonhg.NetBSD.org/src/rev/6c5e9bf2c3e8
branches:  trunk
changeset: 822803:6c5e9bf2c3e8
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Apr 08 13:50:23 2017 +0000

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

diffstat:

 sys/dev/scsipi/cd.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r b88ed6ca22f8 -r 6c5e9bf2c3e8 sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Sat Apr 08 08:49:44 2017 +0000
+++ b/sys/dev/scsipi/cd.c       Sat Apr 08 13:50:23 2017 +0000
@@ -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 @@
            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 @@
        }
 
        periph->periph_flags |= PERIPH_OPEN;
+
+out:
        return 0;
 
 bad2:
@@ -459,7 +464,6 @@
 bad:
        scsipi_adapter_delref(adapt);
        return error;
-
 }
 
 /*



Home | Main Index | Thread Index | Old Index