Introduction
PATCH 1/1 Introduction
Two patches for md/raid in 2.6.recent.
1/ Fix data corruption bug in raid10 when used on
partitions. raid10 is marked "experimental" but it would be good to get this in 2.6.10
2/ Fix jiffies comparison during resync so it behaves
correctly when jiffies wrap. This bug has no performance, security, or data integrity impact.
NeilBrown
PATCH 1/1 Fix careless bug in raid10
raid10 performs resync by reading all blocks, comparing to look for differences, and over-writing blocks that were different. The requires re-tasking a bio that was used to read, so that it can be re-used for write. So a number of fields need to be reset.
The bi_bdev field was not being reset. However when using on a partition of a device, it gets changed by generic_make_request.
This patch simply resets bi_bdev to the correct value.
### Diffstat output
./drivers/md/raid10.c | 1 + 1 files changed, 1 insertion(+)
drivers/md/raid10.c renamed from drivers/md/raid10.c~current~ +1 -0
@@ -1150,6 +1150,7 @@ static void sync_request_write(mddev_t *md_sync_acct (conf->mirrors[d].rdev->bdev, tbio->bi_size >>9 ); tbio->bi_sector += conf->mirrors[d].rdev->data_offset; + tbio->bi_bdev = conf->mirrors[d].rdev->bdev;generic_make_request (tbio); }
PATCH 1/1 Fix jiffies handling in md.c
In reply to NeilBrownUse time_after_eq instead of >=
From: Michal Schmidt <[email protected]>
### Diffstat output
./drivers/md/md.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c renamed from drivers/md/md.c~current~ +1 -1
@@ -3503,7 +3503,7 @@ static void md_do_sync(mddev_t *mddev)break ; repeat: -if (jiffies >= mark[last_mark] +SYNC_MARK_STEP ) { +if (time_after_eq (jiffies, mark[last_mark] +SYNC_MARK_STEP )) {/* step marks */ int next = (last_mark+1 ) %SYNC_MARKS ;