linux/drivers/block/zram
Christoph Hellwig 95848dcb9d zram: take device and not only bvec offset into account
Commit af8b04c637 ("zram: simplify bvec iteration in
__zram_make_request") changed the bio iteration in zram to rely on the
implicit capping to page boundaries in bio_for_each_segment.  But it
failed to care for the fact zram not only care about the page alignment
of the bio payload, but also the page alignment into the device.  For
buffered I/O and swap those are the same, but for direct I/O or kernel
internal I/O like XFS log buffer writes they can differ.

Fix this by open coding bio_for_each_segment and limiting the bvec len
so that it never crosses over a page alignment boundary in the device
in addition to the payload boundary already taken care of by
bio_iter_iovec.

Cc: stable@vger.kernel.org
Fixes: af8b04c637 ("zram: simplify bvec iteration in __zram_make_request")
Reported-by: Dusty Mabe <dusty@dustymabe.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Link: https://lore.kernel.org/r/20230805055537.147835-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-08-05 16:13:15 -06:00
..
Kconfig zram: introduce recompress sysfs knob 2022-11-30 15:58:51 -08:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
zcomp.c zram: preparation for multi-zcomp support 2022-11-30 15:58:51 -08:00
zcomp.h zram: preparation for multi-zcomp support 2022-11-30 15:58:51 -08:00
zram_drv.c zram: take device and not only bvec offset into account 2023-08-05 16:13:15 -06:00
zram_drv.h zram: remove valid_io_request 2023-04-18 16:29:56 -07:00