Package: dmraid
Severity: wishlist
Version: 1.0.0.rc14-1
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu ubuntu-patch hardy ubuntu

Attached is a patch to address some issues with Intel Software RAID metadata 
handling.

This patch is currently in the Ubuntu dmraid package, and therefore the 
attached patch is in dpatch format. It would be nice if this patch was in the 
Debian package, thereby reducing the delta between Ubuntu and Debian. 

Originally taken from Mandriva's dmraid package.

Luke
#! /bin/sh /usr/share/dpatch/dpatch-run
## 06_isw-metadata-fixes.dpatch by Luke Yelavich <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Intel Software RAID metadata fixes.

@DPATCH@
diff -urNad dmraid-1.0.0.rc14-1ubuntu1~/1.0.0.rc14/lib/format/ataraid/isw.c 
dmraid-1.0.0.rc14-1ubuntu1/1.0.0.rc14/lib/format/ataraid/isw.c
--- dmraid-1.0.0.rc14-1ubuntu1~/1.0.0.rc14/lib/format/ataraid/isw.c     
2006-09-23 04:11:37.000000000 +1000
+++ dmraid-1.0.0.rc14-1ubuntu1/1.0.0.rc14/lib/format/ataraid/isw.c      
2008-07-08 14:15:28.000000000 +1000
@@ -364,21 +364,26 @@
 {
        int ret;
        struct isw *isw = META(rd, isw);
+       int large = div_up(isw->mpb_size, ISW_DISK_BLOCK_SIZE) > 1;
 
        to_disk(isw, FULL);
 
-       /*
-        * Copy 1st metadata sector to after the extended ones
-        * and increment metadata area pointer by one block, so
-        * that the metadata is filed in the proper sequence.
-        */
-       memcpy((void*) isw + rd->meta_areas->size, isw, ISW_DISK_BLOCK_SIZE);
-       rd->meta_areas->area += ISW_DISK_BLOCK_SIZE;
+       if (large) {
+               /*
+                * Copy 1st metadata sector to after the extended ones
+                * and increment metadata area pointer by one block, so
+                * that the metadata is filed in the proper sequence.
+                */
+               memcpy((void*) isw + rd->meta_areas->size, isw,
+                      ISW_DISK_BLOCK_SIZE);
+               rd->meta_areas->area += ISW_DISK_BLOCK_SIZE;
+       }
 
        ret = write_metadata(lc, handler, rd, -1, erase);
 
        /* Correct metadata area pointer. */
-       rd->meta_areas->area -= ISW_DISK_BLOCK_SIZE;
+       if (large)
+               rd->meta_areas->area -= ISW_DISK_BLOCK_SIZE;
 
        to_cpu(isw, FULL);
 

Attachment: signature.asc
Description: Digital signature

Reply via email to