[PATCH] 0/1: Hold global HostRAID spares in a special spare array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

The attached patch makes the HostRAID handler put global HostRAID spares
into a hidden array called ".asr_spares".  In the future, event_io will
grab spares from this hidden array when necessary.

This patch should apply cleanly against 1.0.0rc11-pre1.

Questions?  Comments?

--Darrick

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
diff -Naurp v7.orig/lib/format/ataraid/asr.c v7.asr.spare/lib/format/ataraid/asr.c
--- v7.orig/lib/format/ataraid/asr.c	2006-02-17 09:26:44.000000000 -0800
+++ v7.asr.spare/lib/format/ataraid/asr.c	2006-05-12 15:16:10.000000000 -0700
@@ -22,6 +22,8 @@
 
 static const char *handler = HANDLER;
 
+#define SPARE_ARRAY	".asr_spares"
+
 /* Map ASR disk status to dmraid status */
 static enum status disk_status(struct asr_raid_configline *disk) {
 	if (disk == NULL)
@@ -547,6 +549,37 @@ static struct raid_set *asr_group(struct
 	struct raid_set *set, *sset;
 	char buf[BUFSIZE];
 
+	if (T_SPARE(rd)) {
+		/*
+		 * If this drive really _is_ attached to a specific
+		 * RAID set, then just attach it.  Really old HostRAID cards
+		 * do this... but I don't have any hardware to test this.
+		 */
+		/*
+		 * FIXME: dmraid ignores spares attached to RAID arrays.
+		 * For now, we'll let it get sucked into the ASR spare pool. 
+		 * If we need it, we'll reconfigure it; if not, nobody touches
+		 * it.
+		 *
+		set = find_set(lc, name(lc, asr), FIND_TOP, rd, LC_RS(lc),
+			       NO_CREATE, NO_CREATE_ARG);
+		 */
+
+		/* Otherwise, make a global spare pool. */
+		set = find_or_alloc_raid_set(lc, (char*)SPARE_ARRAY,
+			FIND_TOP, rd, LC_RS(lc), NO_CREATE, NO_CREATE_ARG);
+
+		/*
+		 * Setting the type to t_spare guarantees that dmraid won't
+		 * try to set up a real device-mapper mapping.
+		 */
+		set->type = t_spare;
+
+		/* Add the disk to the set. */
+		list_add_sorted(lc, &set->devs, &rd->devs, dev_sort);
+		return set;
+	}
+
 	/* Find the top level FWL/FWL2 for this device. */
 	top_idx = find_toplevel(lc, asr);
 	if (top_idx < 0) {

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________

Ataraid-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/ataraid-list

[Index of Archives]     [Linux RAID]     [Linux Device Mapper]     [Linux IDE]     [Linux SCSI]     [Kernel]     [Linux Books]     [Linux Admin]     [GFS]     [RPM]     [Yosemite Campgrounds]     [AMD 64]

  Powered by Linux