diff options
author | 2017-08-28 13:00:44 -0600 | |
---|---|---|
committer | 2017-08-28 13:00:44 -0600 | |
commit | cd996fb47c360320cf25ac9503c16de085ea9cfc (patch) | |
tree | 38a4730b2c031afe7daf632064f9687f1e09194e /fs/userfaultfd.c | |
parent | block: fix warning when I/O elevator is changed as request_queue is being removed (diff) | |
parent | Linux 4.13-rc7 (diff) | |
download | linux-dev-cd996fb47c360320cf25ac9503c16de085ea9cfc.tar.xz linux-dev-cd996fb47c360320cf25ac9503c16de085ea9cfc.zip |
Merge tag 'v4.13-rc7' into for-4.14/block-postmerge
Linux 4.13-rc7
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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: __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; @@ -1597,7 +1600,7 @@ static int userfaultfd_copy(struct userfaultfd_ctx *ctx, uffdio_copy.len); mmput(ctx->mm); } else { - return -ENOSPC; + return -ESRCH; } if (unlikely(put_user(ret, &user_uffdio_copy->copy))) return -EFAULT; @@ -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 -ESRCH; } if (unlikely(put_user(ret, &user_uffdio_zeropage->zeropage))) return -EFAULT; |