summaryrefslogtreecommitdiff
path: root/restripe.c
diff options
context:
space:
mode:
authorPiergiorgio Sartor <piergiorgio.sartor@nexgo.de>2011-02-18 23:51:19 +1100
committerNeilBrown <neilb@suse.de>2011-02-18 23:51:19 +1100
commitc4db530180e77ecf3fe0920b0f5c563655859dc1 (patch)
tree395375c9fc959ab90cfd8c987de3ad6be96896d9 /restripe.c
parent51cf74194f70ff52ed460395c2bb6b61c2473e06 (diff)
User space RAID-6 access fix
> I have applied some patch - with some formatting changes to make it consistent > with the rest of the code. > > I don't really have time to look more deeply at it at the moment. > Maybe someone else will?... Hi Neil, thanks for including this in git. Actually I did it look at it :-) and I already found a couple of issues, below is a small fix patch. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'restripe.c')
-rw-r--r--restripe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/restripe.c b/restripe.c
index 241e3a4c..a26f9e52 100644
--- a/restripe.c
+++ b/restripe.c
@@ -430,7 +430,8 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
if((Px != 0) && (Qx != 0)) {
- data_id = (raid6_gflog[Qx] - raid6_gflog[Px]) & 0xFF;
+ data_id = (raid6_gflog[Qx] - raid6_gflog[Px]);
+ if(data_id < 0) data_id += 255;
diskD = geo_map(data_id, start/chunk_size,
data_disks + 2, level, layout);
curr_broken_disk = diskD;
@@ -439,6 +440,9 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
if((Px == 0) && (Qx == 0))
curr_broken_disk = curr_broken_disk;
+ if(curr_broken_disk >= data_disks + 2)
+ broken_status = 2;
+
switch(broken_status) {
case 0:
if(curr_broken_disk != -1) {
@@ -450,10 +454,6 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
case 1:
if(curr_broken_disk != prev_broken_disk)
broken_status = 2;
-
- if(curr_broken_disk >= data_disks + 2)
- broken_status = 2;
-
break;
case 2: