diff options
Diffstat (limited to 'fs/userfaultfd.c')
-rw-r--r-- | fs/userfaultfd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index cadcd12a3d35..b0d5897bc4e6 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c | |||
@@ -854,6 +854,9 @@ wakeup: | |||
854 | __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, &range); | 854 | __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, &range); |
855 | spin_unlock(&ctx->fault_pending_wqh.lock); | 855 | spin_unlock(&ctx->fault_pending_wqh.lock); |
856 | 856 | ||
857 | /* Flush pending events that may still wait on event_wqh */ | ||
858 | wake_up_all(&ctx->event_wqh); | ||
859 | |||
857 | wake_up_poll(&ctx->fd_wqh, POLLHUP); | 860 | wake_up_poll(&ctx->fd_wqh, POLLHUP); |
858 | userfaultfd_ctx_put(ctx); | 861 | userfaultfd_ctx_put(ctx); |
859 | return 0; | 862 | return 0; |
@@ -1597,7 +1600,7 @@ static int userfaultfd_copy(struct userfaultfd_ctx *ctx, | |||
1597 | uffdio_copy.len); | 1600 | uffdio_copy.len); |
1598 | mmput(ctx->mm); | 1601 | mmput(ctx->mm); |
1599 | } else { | 1602 | } else { |
1600 | return -ENOSPC; | 1603 | return -ESRCH; |
1601 | } | 1604 | } |
1602 | if (unlikely(put_user(ret, &user_uffdio_copy->copy))) | 1605 | if (unlikely(put_user(ret, &user_uffdio_copy->copy))) |
1603 | return -EFAULT; | 1606 | return -EFAULT; |
@@ -1643,6 +1646,8 @@ static int userfaultfd_zeropage(struct userfaultfd_ctx *ctx, | |||
1643 | ret = mfill_zeropage(ctx->mm, uffdio_zeropage.range.start, | 1646 | ret = mfill_zeropage(ctx->mm, uffdio_zeropage.range.start, |
1644 | uffdio_zeropage.range.len); | 1647 | uffdio_zeropage.range.len); |
1645 | mmput(ctx->mm); | 1648 | mmput(ctx->mm); |
1649 | } else { | ||
1650 | return -ESRCH; | ||
1646 | } | 1651 | } |
1647 | if (unlikely(put_user(ret, &user_uffdio_zeropage->zeropage))) | 1652 | if (unlikely(put_user(ret, &user_uffdio_zeropage->zeropage))) |
1648 | return -EFAULT; | 1653 | return -EFAULT; |