linux/drivers/block
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
..
aoe aoe: make aoe_class a static const structure 2023-06-21 07:45:19 -06:00
drbd Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
mtip32xx block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
null_blk null_blk: Fix: memory release when memory_backed=1 2023-06-05 16:15:35 -06:00
rnbd block/rnbd: make all 'class' structures const 2023-06-21 07:45:19 -06:00
xen-blkback block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
zram zram: take device and not only bvec offset into account 2023-08-05 16:13:15 -06:00
amiflop.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
ataflop.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
brd.c brd: use cond_resched instead of cond_resched_rcu 2023-06-14 11:13:07 -06:00
floppy.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
Kconfig block: ublk: switch to ioctl command encoding 2023-04-18 20:13:30 -06:00
loop.c loop: do not enforce max_loop hard limit by (new) default 2023-07-21 13:20:57 -06:00
Makefile Revert "pktcdvd: remove driver." 2023-01-04 14:44:13 -07:00
n64cart.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
nbd.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
pktcdvd.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
ps3disk.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ps3vram.c ps3vram: remove bio splitting 2023-01-29 15:18:35 -07:00
rbd_types.h libceph, rbd: replace zero-length array with flexible-array 2020-06-01 13:22:53 +02:00
rbd.c for-6.5/block-2023-06-23 2023-06-26 12:47:20 -07:00
sunvdc.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
swim_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
swim.c swim: fix a missing FMODE_ -> BLK_OPEN_ conversion in floppy_open 2023-06-20 07:16:04 -06:00
swim3.c swim3: fix the floppy_locked_ioctl prototype 2023-06-13 09:45:40 -06:00
ublk_drv.c ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV 2023-07-27 07:17:36 -06:00
virtio_blk.c Revert "virtio-blk: support completion batching for the IRQ path" 2023-06-21 04:14:28 -04:00
xen-blkfront.c for-6.5/block-2023-06-23 2023-06-26 12:47:20 -07:00
z2ram.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00