[PATCH] Fixup NVidia

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

 



Hi Heinz,

the nvidia code has a off-by-one bug; it starts to check the possible
signatures from the _end_, but this is in fact set to the number of
possible signatures.
This is actually the reason why dmraid crashes on s390x.
Not that it's need there, but hey.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@xxxxxxx
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de
diff -pur dmraid/1.0.0.rc11.orig/lib/format/ataraid/nv.c dmraid/1.0.0.rc11/lib/format/ataraid/nv.c
--- dmraid/1.0.0.rc11.orig/lib/format/ataraid/nv.c	2006-03-23 13:33:00.000000000 +0100
+++ dmraid/1.0.0.rc11/lib/format/ataraid/nv.c	2006-08-10 16:20:07.000000000 +0200
@@ -151,7 +151,7 @@ static int set_sort(struct list_head *po
 static void to_cpu(void *meta)
 {
 	struct nv *nv = meta;
-	unsigned int i = NV_SIGNATURES;
+	unsigned int i;
 	struct nv_array_base *array = &nv->array;
 
 	CVT32(nv->size);
@@ -162,7 +162,7 @@ static void to_cpu(void *meta)
 	CVT32(nv->unitFlags);
 	CVT32(array->version);
 
-	while (i--);
+	for (i = 0; i < NV_SIGNATURES; i++);
 		CVT32(array->signature[i]);
 
 	CVT32(array->raidLevel);
@@ -221,15 +221,9 @@ static struct raid_dev *nv_read(struct l
 static int nv_write(struct lib_context *lc, struct raid_dev *rd, int erase)
 {
 	int ret;
-#if	BYTE_ORDER != LITTLE_ENDIAN
-	struct nv *nv = META(rd, nv);
 
-	to_disk(nv);
-#endif
 	ret = write_metadata(lc, handler, rd, -1, erase);
-#if	BYTE_ORDER != LITTLE_ENDIAN
-	to_cpu(nv);
-#endif
+
 	return ret;
 }
 
Nur in dmraid/1.0.0.rc11/lib/format/ataraid: nv.c~.
_______________________________________________
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