]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
lightnvm: pblk: delete writer kick timer before stopping thread
authorHans Holmberg <hans.holmberg@cnexlabs.com>
Thu, 29 Mar 2018 22:04:56 +0000 (00:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Mar 2018 23:29:09 +0000 (17:29 -0600)
Unless we delete the timer that wakes up the write thread
before we stop the thread we risk re-starting the thread, so
delete the timer first.

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-init.c

index 8416910ee8bffef572e2d47c7368f3349ca433b3..49c65f1dd48b6316ba2d6e82401ba5f2960df091 100644 (file)
@@ -912,9 +912,9 @@ static void pblk_writer_stop(struct pblk *pblk)
        WARN(pblk_rb_sync_count(&pblk->rwb),
                        "Stopping not fully synced write buffer\n");
 
+       del_timer_sync(&pblk->wtimer);
        if (pblk->writer_ts)
                kthread_stop(pblk->writer_ts);
-       del_timer(&pblk->wtimer);
 }
 
 static void pblk_free(struct pblk *pblk)