VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Mike Rapoport <rppt@linux.vnet.ibm.com> 2017-08-02 13:32:24 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2017-08-02 17:16:13 -0700 commit: 5a18b64e3f02125be1c0ef777501ae38aafe2a24 parent: ade9f91b32b964e83d294f4973d50083b08ef6fc
Commit Summary:
userfaultfd: non-cooperative: flush event_wqh at release time
Diffstat:
1 file changed, 3 insertions, 0 deletions
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 2d8c2d848668..06ea26b8c996 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -854,6 +854,9 @@ wakeup:
 	__wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, &range);
 	spin_unlock(&ctx->fault_pending_wqh.lock);
 
+	/* Flush pending events that may still wait on event_wqh */
+	wake_up_all(&ctx->event_wqh);
+
 	wake_up_poll(&ctx->fd_wqh, POLLHUP);
 	userfaultfd_ctx_put(ctx);
 	return 0;