linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naohiro Aota <naohiro.aota@wdc.com>
To: linux-btrfs@vger.kernel.org, linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>, David Sterba <dsterba@suse.com>,
	Naohiro Aota <naohiro.aota@wdc.com>
Subject: [PATCH v3 0/3] fix argument type of bio_trim()
Date: Wed, 21 Jul 2021 21:43:31 +0900	[thread overview]
Message-ID: <cover.1626871138.git.naohiro.aota@wdc.com> (raw)

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:
- v3:
  - Introduce BIO_MAX_SECTORS instead of a function local const
  - Some style fix
- 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               | 12 +++++++-----
 fs/btrfs/extent_io.c      |  4 +++-
 fs/btrfs/extent_io.h      |  2 +-
 fs/btrfs/inode.c          |  8 ++++----
 include/linux/bio.h       |  2 +-
 include/linux/blk_types.h |  1 +
 6 files changed, 17 insertions(+), 12 deletions(-)

-- 
2.32.0


             reply	other threads:[~2021-07-21 12:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 12:43 Naohiro Aota [this message]
2021-07-21 12:43 ` [PATCH v3 1/3] block: fix arg type of bio_trim() Naohiro Aota
2021-07-21 15:21   ` Christoph Hellwig
2021-07-21 12:43 ` [PATCH v3 2/3] btrfs: fix argument type of btrfs_bio_clone_partial() Naohiro Aota
2021-07-21 15:23   ` Christoph Hellwig
2021-07-21 12:43 ` [PATCH v3 3/3] btrfs: drop unnecessary ASSERT from btrfs_submit_direct() Naohiro Aota
2021-07-21 16:04   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1626871138.git.naohiro.aota@wdc.com \
    --to=naohiro.aota@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dsterba@suse.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).