? o
Index: rf_disks.c
===================================================================
RCS file: /cvsroot/src/sys/dev/raidframe/rf_disks.c,v
retrieving revision 1.87
diff -u -u -r1.87 rf_disks.c
--- rf_disks.c	18 Oct 2014 08:33:28 -0000	1.87
+++ rf_disks.c	12 Jan 2017 15:26:29 -0000
@@ -700,6 +700,24 @@
 }
 
 
+static void
+rf_handle_hosed(RF_Raid_t *raidPtr, RF_Config_t *cfgPtr, int hosed_column)
+{
+	printf("Hosed component: %s\n", &cfgPtr->devnames[0][hosed_column][0]);
+	if (!cfgPtr->force)
+		return;
+
+	/* we'll fail this component, as if there are
+	   other major errors, we arn't forcing things
+	   and we'll abort the config anyways */
+	if (raidPtr->Disks[hosed_column].status == rf_ds_failed)
+		return;
+
+	raidPtr->Disks[hosed_column].status = rf_ds_failed;
+	raidPtr->numFailures++;
+	raidPtr->status = rf_rs_degraded;
+}
+
 /*
 
    rf_CheckLabels() - check all the component labels for consistency.
@@ -823,17 +841,8 @@
 					break;
 				}
 			}
-			printf("Hosed component: %s\n",
-			       &cfgPtr->devnames[0][hosed_column][0]);
-			if (!force) {
-				/* we'll fail this component, as if there are
-				   other major errors, we arn't forcing things
-				   and we'll abort the config anyways */
-				raidPtr->Disks[hosed_column].status
-					= rf_ds_failed;
-				raidPtr->numFailures++;
-				raidPtr->status = rf_rs_degraded;
-			}
+			if (hosed_column != -1)
+				rf_handle_hosed(raidPtr, cfgPtr, hosed_column);
 		} else {
 			too_fatal = 1;
 		}
@@ -889,19 +898,8 @@
 					}
 				}
 			}
-			printf("Hosed component: %s\n",
-			       &cfgPtr->devnames[0][hosed_column][0]);
-			if (!force) {
-				/* we'll fail this component, as if there are
-				   other major errors, we arn't forcing things
-				   and we'll abort the config anyways */
-				if (raidPtr->Disks[hosed_column].status != rf_ds_failed) {
-					raidPtr->Disks[hosed_column].status
-						= rf_ds_failed;
-					raidPtr->numFailures++;
-					raidPtr->status = rf_rs_degraded;
-				}
-			}
+			if (hosed_column != -1)
+				rf_handle_hosed(raidPtr, cfgPtr, hosed_column);
 		} else {
 			too_fatal = 1;
 		}