On Thu, Aug 17, 2017 at 11:40:13PM +0000, tsutomu....@toshiba.co.jp wrote: > If you refer to other implementations in kernel, the following > modifications may be better. > The important thing is to call kthread_should_stop() after > set_current_state(TASK_INTERRUPTIBLE). How is this fix?
Thanks, I prefer this. Perhaps put that explanation in a comment, e.g. > --- fs/dlm/recoverd.c.orig 2017-08-10 16:42:31.131296351 +0900 > +++ fs/dlm/recoverd.c 2017-08-10 16:43:22.483295232 +0900 > @@ -287,8 +287,10 @@ > set_bit(LSFL_RECOVER_LOCK, &ls->ls_flags); > wake_up(&ls->ls_recover_lock_wait); > > - while (!kthread_should_stop()) { > + while (1) { /* call kthread_should_stop() after set_current_state() / > set_current_state(TASK_INTERRUPTIBLE); > + if (kthread_should_stop()) > + break; > if (!test_bit(LSFL_RECOVER_WORK, &ls->ls_flags) && > !test_bit(LSFL_RECOVER_DOWN, &ls->ls_flags)) > schedule(); >