|
@@ -527,16 +527,12 @@ out:
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static int userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx,
|
|
|
|
- struct userfaultfd_wait_queue *ewq)
|
|
|
|
|
|
+static void userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx,
|
|
|
|
+ struct userfaultfd_wait_queue *ewq)
|
|
{
|
|
{
|
|
- int ret;
|
|
|
|
-
|
|
|
|
- ret = -1;
|
|
|
|
if (WARN_ON_ONCE(current->flags & PF_EXITING))
|
|
if (WARN_ON_ONCE(current->flags & PF_EXITING))
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
- ret = 0;
|
|
|
|
ewq->ctx = ctx;
|
|
ewq->ctx = ctx;
|
|
init_waitqueue_entry(&ewq->wq, current);
|
|
init_waitqueue_entry(&ewq->wq, current);
|
|
|
|
|
|
@@ -552,7 +548,6 @@ static int userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx,
|
|
break;
|
|
break;
|
|
if (ACCESS_ONCE(ctx->released) ||
|
|
if (ACCESS_ONCE(ctx->released) ||
|
|
fatal_signal_pending(current)) {
|
|
fatal_signal_pending(current)) {
|
|
- ret = -1;
|
|
|
|
__remove_wait_queue(&ctx->event_wqh, &ewq->wq);
|
|
__remove_wait_queue(&ctx->event_wqh, &ewq->wq);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -573,7 +568,6 @@ static int userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx,
|
|
*/
|
|
*/
|
|
out:
|
|
out:
|
|
userfaultfd_ctx_put(ctx);
|
|
userfaultfd_ctx_put(ctx);
|
|
- return ret;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static void userfaultfd_event_complete(struct userfaultfd_ctx *ctx,
|
|
static void userfaultfd_event_complete(struct userfaultfd_ctx *ctx,
|
|
@@ -631,7 +625,7 @@ int dup_userfaultfd(struct vm_area_struct *vma, struct list_head *fcs)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int dup_fctx(struct userfaultfd_fork_ctx *fctx)
|
|
|
|
|
|
+static void dup_fctx(struct userfaultfd_fork_ctx *fctx)
|
|
{
|
|
{
|
|
struct userfaultfd_ctx *ctx = fctx->orig;
|
|
struct userfaultfd_ctx *ctx = fctx->orig;
|
|
struct userfaultfd_wait_queue ewq;
|
|
struct userfaultfd_wait_queue ewq;
|
|
@@ -641,17 +635,15 @@ static int dup_fctx(struct userfaultfd_fork_ctx *fctx)
|
|
ewq.msg.event = UFFD_EVENT_FORK;
|
|
ewq.msg.event = UFFD_EVENT_FORK;
|
|
ewq.msg.arg.reserved.reserved1 = (unsigned long)fctx->new;
|
|
ewq.msg.arg.reserved.reserved1 = (unsigned long)fctx->new;
|
|
|
|
|
|
- return userfaultfd_event_wait_completion(ctx, &ewq);
|
|
|
|
|
|
+ userfaultfd_event_wait_completion(ctx, &ewq);
|
|
}
|
|
}
|
|
|
|
|
|
void dup_userfaultfd_complete(struct list_head *fcs)
|
|
void dup_userfaultfd_complete(struct list_head *fcs)
|
|
{
|
|
{
|
|
- int ret = 0;
|
|
|
|
struct userfaultfd_fork_ctx *fctx, *n;
|
|
struct userfaultfd_fork_ctx *fctx, *n;
|
|
|
|
|
|
list_for_each_entry_safe(fctx, n, fcs, list) {
|
|
list_for_each_entry_safe(fctx, n, fcs, list) {
|
|
- if (!ret)
|
|
|
|
- ret = dup_fctx(fctx);
|
|
|
|
|
|
+ dup_fctx(fctx);
|
|
list_del(&fctx->list);
|
|
list_del(&fctx->list);
|
|
kfree(fctx);
|
|
kfree(fctx);
|
|
}
|
|
}
|