nfs: allow the v4.1 callback thread to freeze
Subsystems (2)
PATCH 1/1 nfs: allow the v4.1 callback thread to freeze
The v4.1 callback thread has set_freezable() at the top, but it doesn't ever try to freeze within the loop. Have it call try_to_freeze() at the top of the loop. If a freeze event occurs, recheck kthread_should_stop() after thawing.
Reported-by Yanchuan Nian <[email protected]>
Signed-off-by Jeff Layton <[email protected]>
--- fs/nfs/callback.c | 3 +++ 1 file changed, 3 insertions(+)
fs/nfs/callback.c +3 -0
@@ -125,6 +125,9 @@ nfs41_callback_svc(void *vrqstp)set_freezable ();while (!kthread_should_stop ()) { +if (try_to_freeze ()) +continue ; +prepare_to_wait (&serv->sv_cb_waitq, &wq,TASK_INTERRUPTIBLE );spin_lock_bh (&serv->sv_cb_lock);if (!list_empty (&serv->sv_cb_list)) {
Signature · 1 line
1.7.11.7
Quoted 16 lines · Jeff Layton
The v4.1 callback thread has
set_freezable()at the top, but it doesn't ever try to freeze within the loop. Have it calltry_to_freeze()at the top of the loop. If a freeze event occurs, recheckkthread_should_stop()after thawing.Reported-by Yanchuan Nian <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/nfs/callback.c | 3 +++ 1 file changed, 3 insertions(+)fs/nfs/callback.c +0
-0
fs/nfs/callback.c nfs41_callback_svc(void *vrqstp) · line 133
Quoted 9 lines
fs/nfs/callback.c +3
-0@@ -125,6 +125,9 @@ nfs41_callback_svc(void *vrqstp)set_freezable ();while (!kthread_should_stop ()) { +if (try_to_freeze ()) +continue ; +prepare_to_wait (&serv->sv_cb_waitq, &wq,TASK_INTERRUPTIBLE );spin_lock_bh (&serv->sv_cb_lock);if (!list_empty (&serv->sv_cb_list)) {
Tested, and the client suspends successfully now.
Quoted 2 lines
Signature · 1 line
1.7.11.7