md/raid5-cache: Clear conf->log after finishing work
[linux-2.6-microblaze.git] / drivers / md / raid5-cache.c
index d9b94e2..1063dcc 100644 (file)
@@ -3165,12 +3165,13 @@ void r5l_exit_log(struct r5conf *conf)
 {
        struct r5l_log *log = conf->log;
 
-       conf->log = NULL;
-
        /* Ensure disable_writeback_work wakes up and exits */
        wake_up(&conf->mddev->sb_wait);
        flush_work(&log->disable_writeback_work);
        md_unregister_thread(&log->reclaim_thread);
+
+       conf->log = NULL;
+
        mempool_exit(&log->meta_pool);
        bioset_exit(&log->bs);
        mempool_exit(&log->io_pool);