projects
/
wrapfs-3.2.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f8a769
)
block: fix offset/size check in bio_trim()
author
Ming Lei
<ming.lei@redhat.com>
Thu, 14 Apr 2022 08:44:43 +0000
(16:44 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:36:18 +0000
(09:36 +0200)
[ 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
patch
|
blob
|
history
diff --git
a/block/bio.c
b/block/bio.c
index 1be1e360967d09556a99f83c6f91763d8e7385ac..342b1cf5d713c0a873e0ae2324da61e8037e43d5 100644
(file)
--- a/
block/bio.c
+++ b/
block/bio.c
@@
-1570,7
+1570,7
@@
EXPORT_SYMBOL(bio_split);
void bio_trim(struct bio *bio, sector_t offset, sector_t size)
{
if (WARN_ON_ONCE(offset > BIO_MAX_SECTORS || size > BIO_MAX_SECTORS ||
- offset + size > bio
->bi_iter.bi_size
))
+ offset + size > bio
_sectors(bio)
))
return;
size <<= 9;