[PATCH] Promise FastTrack metadata detection

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

 



Hi,

we noticed that dmraid has not been able to detect the metadata for the
following card:
  Model: "Promise FastTrak100 TX2"
  Vendor: pci 0x105a "Promise Technology, Inc."
  Device: pci 0x6268 "PDC20270 (FastTrak100 LP/TX2/TX4)"
  SubVendor: pci 0x105a "Promise Technology, Inc."
  SubDevice: pci 0x4d68 "FastTrak100 TX2"

with a disk size > 128 GB.

The reason is that the BIOS setup tool only detects up to 268435377 sectors
(while the actual size of the tested device is 488397168 sectors).
So the metadata is written at sector 268435377, where it is not detected
by dmraid, because it has a list of offsets from the end of the device.

I am not sure if this limitation applies to more Promise cards. A patch which
works with our test machine is below. Of course it does not allow to use more
than the limit, but at least the metadata is detected and the device can be set
up.

Matthias

Index: 1.0.0.rc14/lib/format/ataraid/pdc.c
===================================================================
--- 1.0.0.rc14.orig/lib/format/ataraid/pdc.c
+++ 1.0.0.rc14/lib/format/ataraid/pdc.c
@@ -155,6 +155,21 @@ static void *pdc_read_metadata(struct li
 			}
 		}
 
+		/* Some pdc card detect only PDC_MAX_SECTOR sectors, even
+		 * if the disk is bigger, this prevents dmraid from discovering
+		 * the metadata. This quirk searches for metadata at the
+		 * sector PDC_MAX_SECTOR
+		 */
+		if (di->sectors >= PDC_MAX_SECTOR) {
+			if (read_file(lc, handler, di->path, ret, sizeof(*ret),
+				      PDC_MAX_SECTOR << 9) &&
+			    !strncmp((const char*) ret->promise_id, PDC_MAGIC,
+				     PDC_ID_LENGTH)) {
+				info->u32 = PDC_MAX_SECTOR;
+				return (void*) ret;
+			}
+		}
+
 		dbg_free(ret);
 	}
 
Index: 1.0.0.rc14/lib/format/ataraid/pdc.h
===================================================================
--- 1.0.0.rc14.orig/lib/format/ataraid/pdc.h
+++ 1.0.0.rc14/lib/format/ataraid/pdc.h
@@ -16,6 +16,9 @@
 #define PDC_CONFIGOFFSETS	63,255,256,16,399,735
 #define	PDC_DATAOFFSET 0
 
+/* maximum device size (sectors) which can be detected by some pdc card */
+#define PDC_MAX_SECTOR 268435377UL
+
 /* Ondisk metadata for Promise Fastrack */
 struct pdc {
 #define PDC_ID_LENGTH	24
_______________________________________________
Ataraid-list mailing list
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