Skip to contentSkip to conversation

md/raid5: remove an incorect assert in in_chunk_boundary

PATCH Applied Christoph Hellwig 5 participants 7 messages May 19, 2021 – May 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 md/raid5: remove an incorect assert in in_chunk_boundary

Now that the original bdev is stored in the bio this assert is incorrect and will trigge for any partitioned raid5 device.

Fixes 309dca309fc3 ("block: store a block_device pointer in struct bio"),
---
 drivers/md/raid5.c | 2 --
 1 file changed, 2 deletions(-)
drivers/md/raid5.c +0 -2
index 841e1c1aa5e6..7d4ff8a5c55e 100644
@@ -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);
Signature · 1 line
2.30.2
#1 lore raw

s/incorect/incorrect/ in the subject, sorry.

Quoted 26 lines · Christoph Hellwig

Now that the original bdev is stored in the bio this assert is incorrect and will trigge for any partitioned raid5 device.

Fixes 309dca309fc3 ("block: store a block_device pointer in struct bio"),
---
 drivers/md/raid5.c | 2 --
 1 file changed, 2 deletions(-)
drivers/md/raid5.c +0 -2
index 841e1c1aa5e6..7d4ff8a5c55e 100644
@@ -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);
Signature · 1 line
2.30.2

---end quoted text---

Reviewed-by
#2 lore raw
Quoted 5 lines · Christoph Hellwig

s/incorect/incorrect/ in the subject, sorry.

Quoted 2 lines · Christoph Hellwig

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

Thanks,
Guoqing

#3 lore raw
In reply to Christoph Hellwig
Quoted 29 lines

Christoph Hellwig <[email protected]> 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.

Fixes 309dca309fc3 ("block: store a block_device pointer in struct bio"),
---
 drivers/md/raid5.c | 2 --
 1 file changed, 2 deletions(-)
drivers/md/raid5.c +0 -2
index 841e1c1aa5e6..7d4ff8a5c55e 100644
@@ -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);
Signature · 1 line
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

maintainer Applied
#4 lore raw
Quoted 23 lines · On Wed, May 19, 2021 at 4:36 AM wp1083705-spam02 wp1083705-spam02…
Quoted 23 lines

Christoph Hellwig <[email protected]> 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.

Fixes 309dca309fc3 ("block: store a block_device pointer in struct bio"),
---
 drivers/md/raid5.c | 2 --
 1 file changed, 2 deletions(-)
drivers/md/raid5.c +0 -0
index 841e1c1aa5e6..7d4ff8a5c55e 100644
@@ -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);
 
Quoted 9 lines
Quoted 7 lines
drivers/md/raid5.c +0 -3
-     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

#5 lore raw

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

Quoted 48 lines · Song Liu
Quoted 6 lines · On Wed, May 19, 2021 at 4:36 AM wp1083705-spam02 wp1083705-spam02…
Quoted 6 lines

Christoph Hellwig <[email protected]> hat am 19.05.2021 08:22 geschrieben:

Now that the original bdev is stored in the bio this assert is

incorrect

Quoted 4 lines
Quoted 4 lines

and will trigge for any partitioned raid5 device.

Fixes 309dca309fc3 ("block: store a block_device pointer in struct

bio"),

Quoted 10 lines

drivers/md/raid5.c static int in_chunk_boundary(struct mddev

Quoted 10 lines
---
 drivers/md/raid5.c | 2 --
 1 file changed, 2 deletions(-)
drivers/md/raid5.c +0 -0
index 841e1c1aa5e6..7d4ff8a5c55e 100644
@@ -5311,8 +5311,6 @@ static int in_chunk_boundary(struct mddev

*mddev, struct bio *bio)

Quoted 6 lines

drivers/md/raid5.c static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)

Quoted 6 lines
drivers/md/raid5.c +0 -2
      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);

Quoted 6 lines
Quoted 4 lines
drivers/md/raid5.c +0 -1
      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

Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.
maintainer
#6 lore raw
Quoted 4 lines · Florian D.

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