NFSv4.1: Fix bug only first CB_NOTIFY_LOCK is handled
authorYihao Wu <wuyihao@linux.alibaba.com>
Mon, 13 May 2019 06:58:22 +0000 (14:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2019 10:20:51 +0000 (12:20 +0200)
commit56e3f73e838ae6315a17b70c99d1fe8bab3aca2d
treeb2c0c3e6150591b70af54abd6af3db374588cff3
parentea0327b47754467e0190212dac1ec578262b8e70
NFSv4.1: Fix bug only first CB_NOTIFY_LOCK is handled

commit ba851a39c9703f09684a541885ed176f8fb7c868 upstream.

When a waiter is waked by CB_NOTIFY_LOCK, it will retry
nfs4_proc_setlk(). The waiter may fail to nfs4_proc_setlk() and sleep
again. However, the waiter is already removed from clp->cl_lock_waitq
when handling CB_NOTIFY_LOCK in nfs4_wake_lock_waiter(). So any
subsequent CB_NOTIFY_LOCK won't wake this waiter anymore. We should
put the waiter back to clp->cl_lock_waitq before retrying.

Cc: stable@vger.kernel.org #4.9+
Signed-off-by: Yihao Wu <wuyihao@linux.alibaba.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c