linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naohiro Aota <Naohiro.Aota@wdc.com>
To: "dsterba@suse.cz" <dsterba@suse.cz>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>, David Sterba <dsterba@suse.com>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: Re: [PATCH 2/3] btrfs: fix argument type of btrfs_bio_clone_partial()
Date: Fri, 9 Jul 2021 05:01:37 +0000	[thread overview]
Message-ID: <20210709050137.63mo3vvf7f6wb46g@naota-xeon> (raw)
In-Reply-To: <20210708150025.GE2610@twin.jikos.cz>

On Thu, Jul 08, 2021 at 05:00:25PM +0200, David Sterba wrote:
> On Thu, Jul 08, 2021 at 10:10:56PM +0900, Naohiro Aota wrote:
> > From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> > 
> > The offset and can never be negative use unsigned int instead of int type
> > for them.
> > 
> > Tested-by: Naohiro Aota <naohiro.aota@wdc.com>
> > Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> > ---
> >  fs/btrfs/extent_io.c | 3 ++-
> >  fs/btrfs/extent_io.h | 3 ++-
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> > index 1f947e24091a..082f135bb3de 100644
> > --- a/fs/btrfs/extent_io.c
> > +++ b/fs/btrfs/extent_io.c
> > @@ -3153,7 +3153,8 @@ struct bio *btrfs_io_bio_alloc(unsigned int nr_iovecs)
> >  	return bio;
> >  }
> >  
> > -struct bio *btrfs_bio_clone_partial(struct bio *orig, int offset, int size)
> > +struct bio *btrfs_bio_clone_partial(struct bio *orig, unsigned int offset,
> > +				    unsigned int size)
> >  {
> >  	struct bio *bio;
> >  	struct btrfs_io_bio *btrfs_bio;
> > diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
> > index 62027f551b44..f78b365b56cf 100644
> > --- a/fs/btrfs/extent_io.h
> > +++ b/fs/btrfs/extent_io.h
> > @@ -280,7 +280,8 @@ void extent_clear_unlock_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
> >  struct bio *btrfs_bio_alloc(u64 first_byte);
> >  struct bio *btrfs_io_bio_alloc(unsigned int nr_iovecs);
> >  struct bio *btrfs_bio_clone(struct bio *bio);
> > -struct bio *btrfs_bio_clone_partial(struct bio *orig, int offset, int size);
> > +struct bio *btrfs_bio_clone_partial(struct bio *orig, unsigned int offset,
> > +				    unsigned int size);
> 
> This is passed to bio_trim that you change to take sector_t, should this
> be the same?

btrfs_bio_clone_partial() expects byte-based value, so using sector_t
is misleading. Should we use u64 here? But the values must be <=
UINT_MAX.

> >  
> >  int repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start,
> >  		      u64 length, u64 logical, struct page *page,
> > -- 
> > 2.32.0

  reply	other threads:[~2021-07-09  5:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 13:10 [PATCH 0/3] fix argument type of bio_trim() Naohiro Aota
2021-07-08 13:10 ` [PATCH 1/3] block: fix arg " Naohiro Aota
2021-07-08 14:57   ` David Sterba
2021-07-09  0:42     ` Damien Le Moal
2021-07-09  4:53       ` Naohiro Aota
2021-07-09  4:39     ` Naohiro Aota
2021-07-09  4:55       ` Naohiro Aota
2021-07-08 13:10 ` [PATCH 2/3] btrfs: fix argument type of btrfs_bio_clone_partial() Naohiro Aota
2021-07-08 15:00   ` David Sterba
2021-07-09  5:01     ` Naohiro Aota [this message]
2021-07-08 13:10 ` [PATCH 3/3] btrfs: drop unnecessary ASSERT from btrfs_submit_direct() Naohiro Aota
2021-07-08 13:54   ` David Sterba
2021-07-08 15:03   ` 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=20210709050137.63mo3vvf7f6wb46g@naota-xeon \
    --to=naohiro.aota@wdc.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --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).