zram: fix synchronous reads
authorChristoph Hellwig <hch@lst.de>
Tue, 11 Apr 2023 17:14:58 +0000 (19:14 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 23:29:59 +0000 (16:29 -0700)
commit4e3c87b9421df497d849ae61aab9762de7f66afb
treec444fa9d5ccb3dddf1cb01345679e20c984a0c4a
parent0cd97a0372f21a66d1591114d0a12391e8d977d7
zram: fix synchronous reads

Currently nothing waits for the synchronous reads before accessing the
data.  Switch them to an on-stack bio and submit_bio_wait to make sure the
I/O has actually completed when the work item has been flushed.  This also
removes the call to page_endio that would unlock a page that has never
been locked.

Drop the partial_io/sync flag, as chaining only makes sense for the
asynchronous reads of the entire page.

Link: https://lkml.kernel.org/r/20230411171459.567614-17-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/zram_drv.c