Benjamin Coddington b7dbcc0e43 NFSv4.1: Fix a race where CB_NOTIFY_LOCK fails to wake a waiter
nfs4_retry_setlk() sets the task's state to TASK_INTERRUPTIBLE within the
same region protected by the wait_queue's lock after checking for a
notification from CB_NOTIFY_LOCK callback.  However, after releasing that
lock, a wakeup for that task may race in before the call to
freezable_schedule_timeout_interruptible() and set TASK_WAKING, then
freezable_schedule_timeout_interruptible() will set the state back to
TASK_INTERRUPTIBLE before the task will sleep.  The result is that the task
will sleep for the entire duration of the timeout.

Since we've already set TASK_INTERRUPTIBLE in the locked section, just use
freezable_schedule_timout() instead.

Fixes: a1d617d8f134 ("nfs: allow blocking locks to be awoken by lock callbacks")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2017-07-28 15:35:30 -04:00
..
2017-05-05 15:24:52 -04:00
2017-03-28 16:16:52 +02:00
2017-05-12 15:57:15 -07:00
2017-04-19 14:21:23 +02:00
2017-07-13 15:58:03 -04:00
2017-04-20 12:09:55 -06:00
2017-05-05 13:36:10 -07:00
2017-05-30 12:38:59 -07:00
2017-06-02 12:29:03 -07:00
2017-04-17 12:52:27 -04:00
2017-02-27 18:43:46 -08:00
2016-12-14 23:48:11 -05:00
2017-02-27 18:43:46 -08:00
2017-05-08 17:15:12 -07:00
2017-06-09 16:28:01 -04:00