On Wed, May 08, 2019 at 05:13:25PM +0800, Yihao Wu wrote:
Commit b7dbcc0e433f ""NFSv4.1: Fix a race where CB_NOTIFY_LOCK fails to wake a waiter" found this bug. However it didn't fix it. This can be fixed by adding memory barrier pair.
Specifically, if any CB_NOTIFY_LOCK should be handled between unlocking the wait queue and freezable_schedule_timeout, only two cases are possible. So CB_NOTIFY_LOCK will not be dropped unexpectly.
- The callback thread marks the NFS client as waked. Then NFS client
noticed that itself is waked, so it don't goes to sleep. And it cleans its wake mark.
- The NFS client noticed that itself is not waked yet, so it goes to
sleep. No modification will ever happen to the wake mark in between.
Fixes: a1d617d ("nfs: allow blocking locks to be awoken by lock callbacks") Signed-off-by: Yihao Wu wuyihao@linux.alibaba.com
fs/nfs/nfs4proc.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.
</formletter>