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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:14 +0000 (09:34 +0200)
commit3e67054c339c9a636d228cb9b0aac5c1c667a99c
tree0d86b779d5f6263c1a3e37932c38de4c9f114d28
parent279018a01b086353ad71c039bb7a70e99f2260f0
block: fix offset/size check in bio_trim()

[ 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>
block/bio.c