diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 84c46a161927..83b6cb3e7025 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -404,8 +404,6 @@ static void md_submit_flush_data(struct work_struct *ws) | |||
404 | mddev_t *mddev = container_of(ws, mddev_t, flush_work); | 404 | mddev_t *mddev = container_of(ws, mddev_t, flush_work); |
405 | struct bio *bio = mddev->flush_bio; | 405 | struct bio *bio = mddev->flush_bio; |
406 | 406 | ||
407 | atomic_set(&mddev->flush_pending, 1); | ||
408 | |||
409 | if (bio->bi_size == 0) | 407 | if (bio->bi_size == 0) |
410 | /* an empty barrier - all done */ | 408 | /* an empty barrier - all done */ |
411 | bio_endio(bio, 0); | 409 | bio_endio(bio, 0); |
@@ -414,10 +412,9 @@ static void md_submit_flush_data(struct work_struct *ws) | |||
414 | if (mddev->pers->make_request(mddev, bio)) | 412 | if (mddev->pers->make_request(mddev, bio)) |
415 | generic_make_request(bio); | 413 | generic_make_request(bio); |
416 | } | 414 | } |
417 | if (atomic_dec_and_test(&mddev->flush_pending)) { | 415 | |
418 | mddev->flush_bio = NULL; | 416 | mddev->flush_bio = NULL; |
419 | wake_up(&mddev->sb_wait); | 417 | wake_up(&mddev->sb_wait); |
420 | } | ||
421 | } | 418 | } |
422 | 419 | ||
423 | void md_flush_request(mddev_t *mddev, struct bio *bio) | 420 | void md_flush_request(mddev_t *mddev, struct bio *bio) |