Module Name:    src
Committed By:   jdolecek
Date:           Mon Apr 10 18:20:43 UTC 2017

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

Log Message:
execute the cache page MODE SENSE with XS_CTL_SILENT; it's pretty normal
for e.g. USB sticks thus showing error is not really useful, and the pretty
printing triggers autoload of scsiverbose module and immediate deadlock when
the DIOCGCACHE call is made by WAPBL during root mount

adresses PR kern/52147 by Michael van Elst


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/dev/scsipi/sd.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/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.323 src/sys/dev/scsipi/sd.c:1.324
--- src/sys/dev/scsipi/sd.c:1.323	Wed Apr  5 20:15:49 2017
+++ src/sys/dev/scsipi/sd.c	Mon Apr 10 18:20:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.323 2017/04/05 20:15:49 jdolecek Exp $	*/
+/*	$NetBSD: sd.c,v 1.324 2017/04/10 18:20:43 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.323 2017/04/05 20:15:49 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.324 2017/04/10 18:20:43 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -1823,7 +1823,7 @@ sd_getcache(struct sd_softc *sd, int *bi
 
 	memset(&scsipi_sense, 0, sizeof(scsipi_sense));
 	error = sd_mode_sense(sd, SMS_DBD, &scsipi_sense,
-	    sizeof(scsipi_sense.pages.caching_params), 8, 0, &big);
+	    sizeof(scsipi_sense.pages.caching_params), 8, XS_CTL_SILENT, &big);
 	if (error)
 		return (error);
 
@@ -1852,7 +1852,7 @@ sd_getcache(struct sd_softc *sd, int *bi
 	memset(&scsipi_sense, 0, sizeof(scsipi_sense));
 	error = sd_mode_sense(sd, SMS_DBD, &scsipi_sense,
 	    sizeof(scsipi_sense.pages.caching_params),
-	    SMS_PCTRL_CHANGEABLE|8, 0, &big);
+	    SMS_PCTRL_CHANGEABLE|8, XS_CTL_SILENT, &big);
 	if (error == 0) {
 		if (big)
 			pages = (void *)(&scsipi_sense.header.big + 1);

Reply via email to