~psusi/ubuntu/precise/dmraid/fix-gpt

« back to all changes in this revision

Viewing changes to debian/patches/06_isw-metadata-fixes.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Giuseppe Iuculano, 6af052c
  • Date: 2009-03-25 22:34:59 UTC
  • mfrom: (2.1.9 sid)
  • mto: (2.4.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090325223459-y54f0rmxem7htn6r
Tags: 1.0.0.rc15-6
[6af052c] Remove 15_isw_incorrect_status_fix.patch, it causes a
segfault. (Closes: #521104)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 06_isw-metadata-fixes.dpatch by Luke Yelavich <themuso@ubuntu.com>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: Intel Software RAID metadata fixes.
6
 
 
7
 
@DPATCH@
8
 
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
9
 
--- dmraid-1.0.0.rc14-1ubuntu1~/1.0.0.rc14/lib/format/ataraid/isw.c     2006-09-23 04:11:37.000000000 +1000
10
 
+++ dmraid-1.0.0.rc14-1ubuntu1/1.0.0.rc14/lib/format/ataraid/isw.c      2008-07-08 14:15:28.000000000 +1000
11
 
@@ -364,21 +364,26 @@
12
 
 {
13
 
        int ret;
14
 
        struct isw *isw = META(rd, isw);
15
 
+       int large = div_up(isw->mpb_size, ISW_DISK_BLOCK_SIZE) > 1;
16
 
 
17
 
        to_disk(isw, FULL);
18
 
 
19
 
-       /*
20
 
-        * Copy 1st metadata sector to after the extended ones
21
 
-        * and increment metadata area pointer by one block, so
22
 
-        * that the metadata is filed in the proper sequence.
23
 
-        */
24
 
-       memcpy((void*) isw + rd->meta_areas->size, isw, ISW_DISK_BLOCK_SIZE);
25
 
-       rd->meta_areas->area += ISW_DISK_BLOCK_SIZE;
26
 
+       if (large) {
27
 
+               /*
28
 
+                * Copy 1st metadata sector to after the extended ones
29
 
+                * and increment metadata area pointer by one block, so
30
 
+                * that the metadata is filed in the proper sequence.
31
 
+                */
32
 
+               memcpy((void*) isw + rd->meta_areas->size, isw,
33
 
+                      ISW_DISK_BLOCK_SIZE);
34
 
+               rd->meta_areas->area += ISW_DISK_BLOCK_SIZE;
35
 
+       }
36
 
 
37
 
        ret = write_metadata(lc, handler, rd, -1, erase);
38
 
 
39
 
        /* Correct metadata area pointer. */
40
 
-       rd->meta_areas->area -= ISW_DISK_BLOCK_SIZE;
41
 
+       if (large)
42
 
+               rd->meta_areas->area -= ISW_DISK_BLOCK_SIZE;
43
 
 
44
 
        to_cpu(isw, FULL);
45