summaryrefslogtreecommitdiffstats
path: root/fs/userfaultfd.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-08-07 10:42:09 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-07 10:42:09 -0700
commitfde6af4729b005dc9dc936b0ed9f1b27b5b2d0f4 (patch)
treefb52e170a7b2130b8a5266ac665d4314447fef95 /fs/userfaultfd.c
parent71feeef678056a640466a6d1faee3a7bcbbccab9 (diff)
parenta8ffcc741acb3c7f3dcf4c7d001209aa0995a5f1 (diff)
downloadlinux-stable-fde6af4729b005dc9dc936b0ed9f1b27b5b2d0f4.tar.gz
linux-stable-fde6af4729b005dc9dc936b0ed9f1b27b5b2d0f4.tar.bz2
linux-stable-fde6af4729b005dc9dc936b0ed9f1b27b5b2d0f4.zip
Merge tag 'mlx5-shared-2017-08-07' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
Saeed Mahameed says: ==================== mlx5-shared-2017-08-07 This series includes some mlx5 updates for both net-next and rdma trees. From Saeed, Core driver updates to allow selectively building the driver with or without some large driver components, such as - E-Switch (Ethernet SRIOV support). - Multi-Physical Function Switch (MPFs) support. For that we split E-Switch and MPFs functionalities into separate files. From Erez, Delay mlx5_core events when mlx5 interfaces, namely mlx5_ib, registration is taking place and until it completes. From Rabie, Increase the maximum supported flow counters. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/userfaultfd.c')
-rw-r--r--fs/userfaultfd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index cadcd12a3d35..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;
@@ -1643,6 +1646,8 @@ static int userfaultfd_zeropage(struct userfaultfd_ctx *ctx,
ret = mfill_zeropage(ctx->mm, uffdio_zeropage.range.start,
uffdio_zeropage.range.len);
mmput(ctx->mm);
+ } else {
+ return -ENOSPC;
}
if (unlikely(put_user(ret, &user_uffdio_zeropage->zeropage)))
return -EFAULT;