md/raid1: clean up request counts properly in close_sync()
[deliverable/linux.git] / drivers / md / raid1.c
index ad0468c42d23c3cccb739874874322531903b38b..a31c92bbcfc9ff7f573d19ac8fba9750e76bf2a7 100644 (file)
@@ -1545,8 +1545,13 @@ static void close_sync(struct r1conf *conf)
        mempool_destroy(conf->r1buf_pool);
        conf->r1buf_pool = NULL;
 
+       spin_lock_irq(&conf->resync_lock);
        conf->next_resync = 0;
        conf->start_next_window = MaxSector;
+       conf->current_window_requests +=
+               conf->next_window_requests;
+       conf->next_window_requests = 0;
+       spin_unlock_irq(&conf->resync_lock);
 }
 
 static int raid1_spare_active(struct mddev *mddev)
This page took 0.030525 seconds and 5 git commands to generate.