linux-stable/drivers/block
Christoph Hellwig 729881aeec zram: take device and not only bvec offset into account
commit 95848dcb9d upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-16 18:32:17 +02:00
..
aoe driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
drbd for-6.4/block-2023-05-06 2023-05-06 08:28:58 -07:00
mtip32xx block: move from strlcpy with unused retval to strscpy 2022-09-21 19:45:04 -06:00
null_blk null_blk: Fix: memory release when memory_backed=1 2023-06-05 16:15:35 -06:00
rnbd block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE 2023-05-12 08:56:42 -06:00
xen-blkback xen/blkback: move blkif_get_x86_*_req() into blkback.c 2023-04-25 11:09:30 +02:00
zram zram: take device and not only bvec offset into account 2023-08-16 18:32:17 +02:00
Kconfig block: ublk: switch to ioctl command encoding 2023-04-18 20:13:30 -06:00
Makefile Revert "pktcdvd: remove driver." 2023-01-04 14:44:13 -07:00
amiflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ataflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
brd.c block/drivers: remove dead clear of random flag 2023-04-25 08:02:11 -06:00
floppy.c mm, treewide: redefine MAX_ORDER sanely 2023-04-05 19:42:46 -07:00
loop.c loop: LOOP_CONFIGURE: send uevents for partitions 2023-03-27 13:27:06 -06:00
n64cart.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
nbd.c nbd: Fix debugfs_create_dir error checking 2023-05-12 08:56:33 -06:00
pktcdvd.c Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07: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.c rbd: prevent busy loop when requesting exclusive lock 2023-08-11 12:14:21 +02:00
rbd_types.h
sunvdc.c block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-15 08:48:58 -06:00
swim.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim3.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim_asm.S
ublk_drv.c ublk: return -EINTR if breaking from waiting for existed users in DEL_DEV 2023-08-03 10:26:00 +02: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 xen/blkfront: Only check REQ_FUA for writes 2023-05-24 16:35:39 +02:00
z2ram.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00