aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 240ff3125040..cacd008d6864 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1818,8 +1818,14 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio)
1818 1818
1819 if (atomic_dec_and_test(&r1_bio->remaining)) { 1819 if (atomic_dec_and_test(&r1_bio->remaining)) {
1820 /* if we're here, all write(s) have completed, so clean up */ 1820 /* if we're here, all write(s) have completed, so clean up */
1821 md_done_sync(mddev, r1_bio->sectors, 1); 1821 int s = r1_bio->sectors;
1822 put_buf(r1_bio); 1822 if (test_bit(R1BIO_MadeGood, &r1_bio->state) ||
1823 test_bit(R1BIO_WriteError, &r1_bio->state))
1824 reschedule_retry(r1_bio);
1825 else {
1826 put_buf(r1_bio);
1827 md_done_sync(mddev, s, 1);
1828 }
1823 } 1829 }
1824} 1830}
1825 1831