Skip to content

Commit

Permalink
nfs: allow the v4.1 callback thread to freeze
Browse files Browse the repository at this point in the history
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 <ycnian@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Jeff Layton authored and Trond Myklebust committed Apr 5, 2013
1 parent 809b426 commit 25d280a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/nfs/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 25d280a

Please sign in to comment.