diff options
author | NeilBrown <neilb@suse.de> | 2015-07-20 09:15:13 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-07-20 09:15:13 +0200 |
commit | eae01ef02fe3a7dd9b71129343f905ac212c6658 (patch) | |
tree | 40503f4280c23a0a2366c9063022105f932b39b9 /restripe.c | |
parent | raid6check: various cleanup/fixes (diff) | |
download | mdadm-eae01ef02fe3a7dd9b71129343f905ac212c6658.tar.xz mdadm-eae01ef02fe3a7dd9b71129343f905ac212c6658.zip |
restripe: fix data block order in raid6_2_data_recov
... rather than relying on the caller getting them in the
correct order.
This is better engineering and fixes a bug, but because the
failed_slotX numbers are used later with assumption that
they weren't swapped
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'restripe.c')
-rw-r--r-- | restripe.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -354,6 +354,12 @@ void raid6_2data_recov(int disks, size_t bytes, int faila, int failb, const uint8_t *pbmul; /* P multiplier table for B data */ const uint8_t *qmul; /* Q multiplier table (for both) */ + if (faila > failb) { + int t = faila; + faila = failb; + failb = t; + } + if (neg_offset) { p = ptrs[-1]; q = ptrs[-2]; @@ -651,11 +657,6 @@ int save_stripes(int *source, unsigned long long *offsets, raid6_datap_recov(syndrome_disks+2, chunk_size, fdisk[0], bufs, 0); else { - if (fdisk[0] > fdisk[1]) { - int t = fdisk[0]; - fdisk[0] = fdisk[1]; - fdisk[1] = t; - } /* Two data blocks failed, P,Q OK */ raid6_2data_recov(syndrome_disks+2, chunk_size, fdisk[0], fdisk[1], bufs, 0); |