drbd: Bugfix: rs_in_flight could become wrong if read_for_csum() requested reschedule later
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
parent
778f271dfe
commit
d207450cf2
1 changed files with 3 additions and 1 deletions
|
@ -512,7 +512,7 @@ int w_make_resync_request(struct drbd_conf *mdev,
|
||||||
sector_t sector;
|
sector_t sector;
|
||||||
const sector_t capacity = drbd_get_capacity(mdev->this_bdev);
|
const sector_t capacity = drbd_get_capacity(mdev->this_bdev);
|
||||||
int max_segment_size;
|
int max_segment_size;
|
||||||
int number, i, size, pe, mx;
|
int number, i, rollback_i, size, pe, mx;
|
||||||
int align, queued, sndbuf;
|
int align, queued, sndbuf;
|
||||||
|
|
||||||
if (unlikely(cancel))
|
if (unlikely(cancel))
|
||||||
|
@ -613,6 +613,7 @@ next_sector:
|
||||||
* be prepared for all stripe sizes of software RAIDs.
|
* be prepared for all stripe sizes of software RAIDs.
|
||||||
*/
|
*/
|
||||||
align = 1;
|
align = 1;
|
||||||
|
rollback_i = i;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (size + BM_BLOCK_SIZE > max_segment_size)
|
if (size + BM_BLOCK_SIZE > max_segment_size)
|
||||||
break;
|
break;
|
||||||
|
@ -654,6 +655,7 @@ next_sector:
|
||||||
case 2: /* Allocation failed */
|
case 2: /* Allocation failed */
|
||||||
drbd_rs_complete_io(mdev, sector);
|
drbd_rs_complete_io(mdev, sector);
|
||||||
mdev->bm_resync_fo = BM_SECT_TO_BIT(sector);
|
mdev->bm_resync_fo = BM_SECT_TO_BIT(sector);
|
||||||
|
i = rollback_i;
|
||||||
goto requeue;
|
goto requeue;
|
||||||
/* case 1: everything ok */
|
/* case 1: everything ok */
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue