Module Name:    src
Committed By:   mlelstv
Date:           Sat Feb 24 22:06:50 UTC 2024

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

Log Message:
Don't try to discover wedges when the unit isn't online.


To generate a diff of this commit:
cvs rdiff -u -r1.335 -r1.336 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.335 src/sys/dev/scsipi/sd.c:1.336
--- src/sys/dev/scsipi/sd.c:1.335	Sun Aug 28 10:26:37 2022
+++ src/sys/dev/scsipi/sd.c	Sat Feb 24 22:06:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.335 2022/08/28 10:26:37 mlelstv Exp $	*/
+/*	$NetBSD: sd.c,v 1.336 2024/02/24 22:06:49 mlelstv 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.335 2022/08/28 10:26:37 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.336 2024/02/24 22:06:49 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -351,8 +351,9 @@ sdattach(device_t parent, device_t self,
 	}
 	aprint_normal("\n");
 
-	/* Discover wedges on this disk. */
-	dkwedge_discover(&dksc->sc_dkdev);
+	/* Discover wedges on this disk if it is online */
+	if (result == SDGP_RESULT_OK)
+		dkwedge_discover(&dksc->sc_dkdev);
 
 	/*
 	 * Establish a shutdown hook so that we can ensure that

Reply via email to