diff mbox series

[v3,11/11] md/raid5-ppl: Fix argument order in bio_alloc_bioset()

Message ID 20220602181818.50729-12-logang@deltatee.com (mailing list archive)
State New, archived
Headers show
Series Bug fixes for mdadm tests | expand

Commit Message

Logan Gunthorpe June 2, 2022, 6:18 p.m. UTC
bio_alloc_bioset() takes a block device, number of vectors, the
OP flags, the GFP mask and the bio set. However when the prototype
was changed, the callisite in ppl_do_flush() had the OP flags and
the GFP flags reversed. This introduced some sparse error:

  drivers/md/raid5-ppl.c:632:57: warning: incorrect type in argument 3
				    (different base types)
  drivers/md/raid5-ppl.c:632:57:    expected unsigned int opf
  drivers/md/raid5-ppl.c:632:57:    got restricted gfp_t [usertype]
  drivers/md/raid5-ppl.c:633:61: warning: incorrect type in argument 4
  				    (different base types)
  drivers/md/raid5-ppl.c:633:61:    expected restricted gfp_t [usertype]
				    gfp_mask
  drivers/md/raid5-ppl.c:633:61:    got unsigned long long

The sparse error introduction may not have been reported correctly by
0day due to other work that was cleaning up other sparse errors in this
area.

Fixes: 609be1066731 ("block: pass a block_device and opf to bio_alloc_bioset")
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
---
 drivers/md/raid5-ppl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig June 3, 2022, 6:45 a.m. UTC | #1
On Thu, Jun 02, 2022 at 12:18:17PM -0600, Logan Gunthorpe wrote:
> bio_alloc_bioset() takes a block device, number of vectors, the
> OP flags, the GFP mask and the bio set. However when the prototype
> was changed, the callisite in ppl_do_flush() had the OP flags and
> the GFP flags reversed. This introduced some sparse error:
> 
>   drivers/md/raid5-ppl.c:632:57: warning: incorrect type in argument 3
> 				    (different base types)
>   drivers/md/raid5-ppl.c:632:57:    expected unsigned int opf
>   drivers/md/raid5-ppl.c:632:57:    got restricted gfp_t [usertype]
>   drivers/md/raid5-ppl.c:633:61: warning: incorrect type in argument 4
>   				    (different base types)
>   drivers/md/raid5-ppl.c:633:61:    expected restricted gfp_t [usertype]
> 				    gfp_mask
>   drivers/md/raid5-ppl.c:633:61:    got unsigned long long
> 
> The sparse error introduction may not have been reported correctly by
> 0day due to other work that was cleaning up other sparse errors in this
> area.
> 
> Fixes: 609be1066731 ("block: pass a block_device and opf to bio_alloc_bioset")
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>

Ooops.  Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

(and should probably be first in the series)
diff mbox series

Patch

diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 4f5bdb4cad2b..db49edec362a 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -629,9 +629,9 @@  static void ppl_do_flush(struct ppl_io_unit *io)
 		if (bdev) {
 			struct bio *bio;
 
-			bio = bio_alloc_bioset(bdev, 0, GFP_NOIO,
+			bio = bio_alloc_bioset(bdev, 0,
 					       REQ_OP_WRITE | REQ_PREFLUSH,
-					       &ppl_conf->flush_bs);
+					       GFP_NOIO, &ppl_conf->flush_bs);
 			bio->bi_private = io;
 			bio->bi_end_io = ppl_flush_endio;