Commit 9dda0fc3 authored by Jens Axboe's avatar Jens Axboe Committed by Stephen Rothwell

mm/page_io.c: fix polled swap page in

swap_readpage() wants to do polling to bring in pages if asked to, but it
doesn't mark the bio as being polled.  Additionally, the looping around
the blk_poll() check isn't correct - if we get a zero return, we should
call io_schedule(), we can't just assume that the bio has completed.  The
regular bio->bi_private check should be used for that.

Link: default avatarJens Axboe <>
Reviewed-by: default avatarAndrew Morton <>
Cc: Christoph Hellwig <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarStephen Rothwell <>
parent 7e4be1f4
......@@ -401,6 +401,8 @@ int swap_readpage(struct page *page, bool synchronous)
bio->bi_private = current;
bio_set_op_attrs(bio, REQ_OP_READ, 0);
if (synchronous)
bio->bi_opf |= REQ_HIPRI;
qc = submit_bio(bio);
......@@ -411,7 +413,7 @@ int swap_readpage(struct page *page, bool synchronous)
if (!blk_poll(disk->queue, qc, true))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment