]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
block: fix offset/size check in bio_trim()
authorMing Lei <ming.lei@redhat.com>
Thu, 14 Apr 2022 08:44:43 +0000 (16:44 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 10:00:52 +0000 (12:00 +0200)
commitcbddbfc667dd6ffc19b0fc448103bd295289ec40
treeeb8c30b0e7ad937ba2de481fcd3a28116a9f57ee
parentaa264ae298522a5d340fa8812e340b4291ae850b
block: fix offset/size check in bio_trim()

BugLink: https://bugs.launchpad.net/bugs/1969857
[ Upstream commit 8535c0185d14ea41f0efd6a357961b05daf6687e ]

Unit of bio->bi_iter.bi_size is bytes, but unit of offset/size
is sector.

Fix the above issue in checking offset/size in bio_trim().

Fixes: e83502ca5f1e ("block: fix argument type of bio_trim()")
Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220414084443.1736850-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
block/bio.c