diff options
-rw-r--r-- | drivers/md/bitmap.c | 7 | ||||
-rw-r--r-- | drivers/md/raid0.c | 4 | ||||
-rw-r--r-- | drivers/md/raid5.c | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 2bc56e2a3526..135a0907e9de 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -177,11 +177,16 @@ static struct md_rdev *next_active_rdev(struct md_rdev *rdev, struct mddev *mdde | |||
177 | * nr_pending is 0 and In_sync is clear, the entries we return will | 177 | * nr_pending is 0 and In_sync is clear, the entries we return will |
178 | * still be in the same position on the list when we re-enter | 178 | * still be in the same position on the list when we re-enter |
179 | * list_for_each_entry_continue_rcu. | 179 | * list_for_each_entry_continue_rcu. |
180 | * | ||
181 | * Note that if entered with 'rdev == NULL' to start at the | ||
182 | * beginning, we temporarily assign 'rdev' to an address which | ||
183 | * isn't really an rdev, but which can be used by | ||
184 | * list_for_each_entry_continue_rcu() to find the first entry. | ||
180 | */ | 185 | */ |
181 | rcu_read_lock(); | 186 | rcu_read_lock(); |
182 | if (rdev == NULL) | 187 | if (rdev == NULL) |
183 | /* start at the beginning */ | 188 | /* start at the beginning */ |
184 | rdev = list_entry_rcu(&mddev->disks, struct md_rdev, same_set); | 189 | rdev = list_entry(&mddev->disks, struct md_rdev, same_set); |
185 | else { | 190 | else { |
186 | /* release the previous rdev and start from there. */ | 191 | /* release the previous rdev and start from there. */ |
187 | rdev_dec_pending(rdev, mddev); | 192 | rdev_dec_pending(rdev, mddev); |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 6a68ef5246d4..efb654eb5399 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -524,6 +524,9 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio) | |||
524 | ? (sector & (chunk_sects-1)) | 524 | ? (sector & (chunk_sects-1)) |
525 | : sector_div(sector, chunk_sects)); | 525 | : sector_div(sector, chunk_sects)); |
526 | 526 | ||
527 | /* Restore due to sector_div */ | ||
528 | sector = bio->bi_iter.bi_sector; | ||
529 | |||
527 | if (sectors < bio_sectors(bio)) { | 530 | if (sectors < bio_sectors(bio)) { |
528 | split = bio_split(bio, sectors, GFP_NOIO, fs_bio_set); | 531 | split = bio_split(bio, sectors, GFP_NOIO, fs_bio_set); |
529 | bio_chain(split, bio); | 532 | bio_chain(split, bio); |
@@ -531,7 +534,6 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio) | |||
531 | split = bio; | 534 | split = bio; |
532 | } | 535 | } |
533 | 536 | ||
534 | sector = bio->bi_iter.bi_sector; | ||
535 | zone = find_zone(mddev->private, §or); | 537 | zone = find_zone(mddev->private, §or); |
536 | tmp_dev = map_sector(mddev, zone, sector, §or); | 538 | tmp_dev = map_sector(mddev, zone, sector, §or); |
537 | split->bi_bdev = tmp_dev->bdev; | 539 | split->bi_bdev = tmp_dev->bdev; |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 1ba97fdc6df1..b9f2b9cc6060 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -1822,7 +1822,7 @@ again: | |||
1822 | } else | 1822 | } else |
1823 | init_async_submit(&submit, 0, tx, NULL, NULL, | 1823 | init_async_submit(&submit, 0, tx, NULL, NULL, |
1824 | to_addr_conv(sh, percpu, j)); | 1824 | to_addr_conv(sh, percpu, j)); |
1825 | async_gen_syndrome(blocks, 0, count+2, STRIPE_SIZE, &submit); | 1825 | tx = async_gen_syndrome(blocks, 0, count+2, STRIPE_SIZE, &submit); |
1826 | if (!last_stripe) { | 1826 | if (!last_stripe) { |
1827 | j++; | 1827 | j++; |
1828 | sh = list_first_entry(&sh->batch_list, struct stripe_head, | 1828 | sh = list_first_entry(&sh->batch_list, struct stripe_head, |