diff mbox series

md/raid5: remove an incorect assert in in_chunk_boundary

Message ID 20210519062215.4111256-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series md/raid5: remove an incorect assert in in_chunk_boundary | expand

Commit Message

Christoph Hellwig May 19, 2021, 6:22 a.m. UTC
Now that the original bdev is stored in the bio this assert is incorrect
and will trigge for any partitioned raid5 device.

Reported-by:  Florian D. <spam02@dazinger.net>
Fixes: 309dca309fc3 ("block: store a block_device pointer in struct bio"),
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/raid5.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Christoph Hellwig May 19, 2021, 6:24 a.m. UTC | #1
s/incorect/incorrect/ in the subject, sorry.

On Wed, May 19, 2021 at 08:22:15AM +0200, Christoph Hellwig wrote:
> Now that the original bdev is stored in the bio this assert is incorrect
> and will trigge for any partitioned raid5 device.
> 
> Reported-by:  Florian D. <spam02@dazinger.net>
> Fixes: 309dca309fc3 ("block: store a block_device pointer in struct bio"),
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/md/raid5.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 841e1c1aa5e6..7d4ff8a5c55e 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -5311,8 +5311,6 @@ static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
>  	unsigned int chunk_sectors;
>  	unsigned int bio_sectors = bio_sectors(bio);
>  
> -	WARN_ON_ONCE(bio->bi_bdev->bd_partno);
> -
>  	chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
>  	return  chunk_sectors >=
>  		((sector & (chunk_sectors - 1)) + bio_sectors);
> -- 
> 2.30.2
> 
---end quoted text---
Guoqing Jiang May 19, 2021, 7:57 a.m. UTC | #2
On 5/19/21 2:24 PM, Christoph Hellwig wrote:
> s/incorect/incorrect/ in the subject, sorry.
>
> On Wed, May 19, 2021 at 08:22:15AM +0200, Christoph Hellwig wrote:
>> Now that the original bdev is stored in the bio this assert is incorrect
>> and will trigge for any partitioned raid5 device.

Maybe s/trigge/trigger/? Anyway

Reviewed-by:  Guoqing Jiang <jiangguoqing@kylinos.cn>

Thanks,
Guoqing
Florian D. May 19, 2021, 11:01 a.m. UTC | #3
> Christoph Hellwig <hch@lst.de> hat am 19.05.2021 08:22 geschrieben:
> 
>  
> Now that the original bdev is stored in the bio this assert is incorrect
> and will trigge for any partitioned raid5 device.
> 
> Reported-by:  Florian D. <spam02@dazinger.net>
> Fixes: 309dca309fc3 ("block: store a block_device pointer in struct bio"),
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/md/raid5.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 841e1c1aa5e6..7d4ff8a5c55e 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -5311,8 +5311,6 @@ static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
>  	unsigned int chunk_sectors;
>  	unsigned int bio_sectors = bio_sectors(bio);
>  
> -	WARN_ON_ONCE(bio->bi_bdev->bd_partno);
> -
>  	chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
>  	return  chunk_sectors >=
>  		((sector & (chunk_sectors - 1)) + bio_sectors);
> -- 
> 2.30.2

yes, this solves it, I can confirm with this patch the error/warning message when booting linux-5.12 is gone!

Thanks a lot!
Florian
Song Liu May 24, 2021, 4:38 a.m. UTC | #4
On Wed, May 19, 2021 at 4:36 AM wp1083705-spam02 wp1083705-spam02
<spam02@dazinger.net> wrote:
>
>
> > Christoph Hellwig <hch@lst.de> hat am 19.05.2021 08:22 geschrieben:
> >
> >
> > Now that the original bdev is stored in the bio this assert is incorrect
> > and will trigge for any partitioned raid5 device.
> >
> > Reported-by:  Florian D. <spam02@dazinger.net>
> > Fixes: 309dca309fc3 ("block: store a block_device pointer in struct bio"),
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
> >  drivers/md/raid5.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> > index 841e1c1aa5e6..7d4ff8a5c55e 100644
> > --- a/drivers/md/raid5.c
> > +++ b/drivers/md/raid5.c
> > @@ -5311,8 +5311,6 @@ static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
> >       unsigned int chunk_sectors;
> >       unsigned int bio_sectors = bio_sectors(bio);
> >
> > -     WARN_ON_ONCE(bio->bi_bdev->bd_partno);
> > -
> >       chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
> >       return  chunk_sectors >=
> >               ((sector & (chunk_sectors - 1)) + bio_sectors);
> > --
> > 2.30.2
>
> yes, this solves it, I can confirm with this patch the error/warning message when booting linux-5.12 is gone!

Applied to md-fixes. Thanks all.

@ Florian, would you like to update the Reported-by tag (with your
full name and/or
different email)?

Thanks,
Song
Florian D. May 24, 2021, 11 a.m. UTC | #5
As you like... if it's better in the 'tested by:' line, you can also take my full name: Florian Dazinger.
 I use the e- mail address regularly, so that's ok.

Thanks for the quick patch!
Florian

On 24 May 2021 06:38:35 CEST, Song Liu <song@kernel.org> wrote:
>On Wed, May 19, 2021 at 4:36 AM wp1083705-spam02 wp1083705-spam02
><spam02@dazinger.net> wrote:
>>
>>
>> > Christoph Hellwig <hch@lst.de> hat am 19.05.2021 08:22 geschrieben:
>> >
>> >
>> > Now that the original bdev is stored in the bio this assert is
>incorrect
>> > and will trigge for any partitioned raid5 device.
>> >
>> > Reported-by:  Florian D. <spam02@dazinger.net>
>> > Fixes: 309dca309fc3 ("block: store a block_device pointer in struct
>bio"),
>> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>> > ---
>> >  drivers/md/raid5.c | 2 --
>> >  1 file changed, 2 deletions(-)
>> >
>> > diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
>> > index 841e1c1aa5e6..7d4ff8a5c55e 100644
>> > --- a/drivers/md/raid5.c
>> > +++ b/drivers/md/raid5.c
>> > @@ -5311,8 +5311,6 @@ static int in_chunk_boundary(struct mddev
>*mddev, struct bio *bio)
>> >       unsigned int chunk_sectors;
>> >       unsigned int bio_sectors = bio_sectors(bio);
>> >
>> > -     WARN_ON_ONCE(bio->bi_bdev->bd_partno);
>> > -
>> >       chunk_sectors = min(conf->chunk_sectors,
>conf->prev_chunk_sectors);
>> >       return  chunk_sectors >=
>> >               ((sector & (chunk_sectors - 1)) + bio_sectors);
>> > --
>> > 2.30.2
>>
>> yes, this solves it, I can confirm with this patch the error/warning
>message when booting linux-5.12 is gone!
>
>Applied to md-fixes. Thanks all.
>
>@ Florian, would you like to update the Reported-by tag (with your
>full name and/or
>different email)?
>
>Thanks,
>Song
Song Liu May 26, 2021, 1:05 a.m. UTC | #6
On Mon, May 24, 2021 at 4:00 AM Florian D. <spam02@dazinger.net> wrote:
>
> As you like... if it's better in the 'tested by:' line, you can also take my full name: Florian Dazinger.
>  I use the e- mail address regularly, so that's ok.
>

Added both Reported-by and Tested-by with your full name.

Thanks,
Song
diff mbox series

Patch

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 841e1c1aa5e6..7d4ff8a5c55e 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5311,8 +5311,6 @@  static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
 	unsigned int chunk_sectors;
 	unsigned int bio_sectors = bio_sectors(bio);
 
-	WARN_ON_ONCE(bio->bi_bdev->bd_partno);
-
 	chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
 	return  chunk_sectors >=
 		((sector & (chunk_sectors - 1)) + bio_sectors);