Module Name:    src
Committed By:   christos
Date:           Sat Apr  7 05:38:07 UTC 2012

Modified Files:
        src/sys/kern: subr_disk_open.c

Log Message:
make this bitch less when we have wedges (EBUSY for the underlying disks)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_disk_open.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/kern/subr_disk_open.c
diff -u src/sys/kern/subr_disk_open.c:1.6 src/sys/kern/subr_disk_open.c:1.7
--- src/sys/kern/subr_disk_open.c:1.6	Sat Nov 26 19:38:12 2011
+++ src/sys/kern/subr_disk_open.c	Sat Apr  7 01:38:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk_open.c,v 1.6 2011/11/27 00:38:12 tsutsui Exp $	*/
+/*	$NetBSD: subr_disk_open.c,v 1.7 2012/04/07 05:38:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk_open.c,v 1.6 2011/11/27 00:38:12 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk_open.c,v 1.7 2012/04/07 05:38:07 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -66,15 +66,20 @@ opendisk(struct device *dv)
 		    device_xname(dv));
 	error = VOP_OPEN(tmpvn, FREAD | FSILENT, NOCRED);
 	if (error) {
-#ifndef DEBUG
 		/*
 		 * Ignore errors caused by missing device, partition,
-		 * or medium.
+		 * medium, or busy [presumably because of a wedge covering it]
 		 */
-		if (error != ENXIO && error != ENODEV)
-#endif
+		switch (error) {
+		case ENXIO:
+		case ENODEV:
+		case EBUSY:
+			break;
+		default:
 			printf("%s: can't open dev %s (%d)\n",
 			    __func__, device_xname(dv), error);
+			break;
+		}
 		vput(tmpvn);
 		return NULL;
 	}

Reply via email to