diff --git a/fs/aio.c b/fs/aio.c index e5f1f2ba9d143eb0941ede56ab1224b7c5fb6f0f..8e624e3a7be981322a22481a88a2d4f133098d18 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1662,13 +1662,13 @@ static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, struct aio_kiocb *iocb = container_of(req, struct aio_kiocb, poll); __poll_t mask = key_to_poll(key); + /* for instances that support it check for an event match first: */ + if (mask && !(mask & req->events)) + return 0; + req->woken = true; - /* for instances that support it check for an event match first: */ if (mask) { - if (!(mask & req->events)) - return 0; - /* try to complete the iocb inline if we can: */ if (spin_trylock(&iocb->ki_ctx->ctx_lock)) { list_del(&iocb->ki_list);