]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix argument type of bio_trim()
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Wed, 21 Jul 2021 12:43:32 +0000 (21:43 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Aug 2021 11:19:08 +0000 (13:19 +0200)
commit524667a5dee38f3ae3ac88ce8f012f3f42377e71
tree06c37c2389e478cfd1edd9033b6ff0e22c3677ea
parenteed4cb80ae4b69bf6e2c05049d9c10c3fc1b60be
block: fix argument type of bio_trim()

The function bio_trim has offset and size arguments that are declared
as int.

The callers of this function use sector_t type when passing the offset
and size, e.g. drivers/md/raid1.c:narrow_write_error() and
drivers/md/raid1.c:narrow_write_error().

Change offset and size arguments to sector_t type for bio_trim(). Also,
add WARN_ON_ONCE() to catch their overflow.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
block/bio.c
include/linux/bio.h
include/linux/blk_types.h