Module Name:    src
Committed By:   oster
Date:           Sat Aug 28 16:00:52 UTC 2021

Modified Files:
        src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
If there is a FS_RAID partition on a disk, then we shouldn't look at
the raw partition.  In particular, we now need to account for the case
where an existing FS_RAID partition is now open because it is in use.
If that is the case, we don't look at the raw partition.

Addresses PR kern/56369.


To generate a diff of this commit:
cvs rdiff -u -r1.399 -r1.400 src/sys/dev/raidframe/rf_netbsdkintf.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/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.399 src/sys/dev/raidframe/rf_netbsdkintf.c:1.400
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.399	Sat Aug  7 16:19:15 2021
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Sat Aug 28 16:00:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_netbsdkintf.c,v 1.399 2021/08/07 16:19:15 thorpej Exp $	*/
+/*	$NetBSD: rf_netbsdkintf.c,v 1.400 2021/08/28 16:00:52 oster Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.399 2021/08/07 16:19:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.400 2021/08/28 16:00:52 oster Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -3040,7 +3040,19 @@ rf_find_raid_components(void)
 				vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 				error = VOP_OPEN(vp, FREAD, NOCRED);
 				if (error) {
-					/* Whatever... */
+					/* Not quite a 'whatever'.  In
+					 * this situation we know 
+					 * there is a FS_RAID
+					 * partition, but we can't
+					 * open it.  The most likely
+					 * reason is that the
+					 * partition is already in
+					 * use by another RAID set.
+					 * So note that we've already
+					 * found a partition on this
+					 * disk so we don't attempt
+					 * to use the raw disk later. */
+					rf_part_found = 1;
 					vput(vp);
 					continue;
 				}

Reply via email to