linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] fix argument type of bio_trim()
@ 2021-07-21  6:26 Naohiro Aota
  2021-07-21  6:26 ` [PATCH v2 1/3] block: fix arg " Naohiro Aota
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Naohiro Aota @ 2021-07-21  6:26 UTC (permalink / raw)
  To: linux-btrfs, linux-block
  Cc: Jens Axboe, David Sterba, Chaitanya Kulkarni, Naohiro Aota

The function bio_trim has offset and size arguments that are declared as
int. But it actually expects sector value and the range of int is not
enough for bio->bi_iter.bi_size and bio_advance() which is/takes unsigned
int. So, let's fix the argument type of bio_trim() and its callers.

Patches 1 and 2 fix bio_trim() argument and its caller's argument.

Patch 3 is depending on patch 1 and 2 and do some cleanup for btrfs.

Changes:
- v2:
  - Add WARN_ON and ASSERT to catch overflow values
  - Change argument type of btrfs_bio_clone_partial() to u64

Chaitanya Kulkarni (2):
  block: fix arg type of bio_trim()
  btrfs: fix argument type of btrfs_bio_clone_partial()

Naohiro Aota (1):
  btrfs: drop unnecessary ASSERT from btrfs_submit_direct()

 block/bio.c          | 14 +++++++++++---
 fs/btrfs/extent_io.c |  6 ++++--
 fs/btrfs/extent_io.h |  2 +-
 fs/btrfs/inode.c     |  8 ++++----
 include/linux/bio.h  |  2 +-
 5 files changed, 21 insertions(+), 11 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-07-21 12:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  6:26 [PATCH v2 0/3] fix argument type of bio_trim() Naohiro Aota
2021-07-21  6:26 ` [PATCH v2 1/3] block: fix arg " Naohiro Aota
2021-07-21  6:36   ` Christoph Hellwig
2021-07-21 11:47     ` Naohiro Aota
2021-07-21  6:26 ` [PATCH v2 2/3] btrfs: fix argument type of btrfs_bio_clone_partial() Naohiro Aota
2021-07-21  6:37   ` Christoph Hellwig
2021-07-21 12:33     ` Naohiro Aota
2021-07-21  6:27 ` [PATCH v2 3/3] btrfs: drop unnecessary ASSERT from btrfs_submit_direct() Naohiro Aota

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).