Skip to content

Commit

Permalink
compat: actually, bio_alloc now has 4 params
Browse files Browse the repository at this point in the history
The original compat check for this got a bit wrapped around the axle.
Both bio_alloc() and bio_alloc_bioset() grew 2 more arguments.  All
the comments and filenames from b6d4d58 say "bio_alloc has 5
params", but it was actually bio_alloc_bioset() that now has 5 params.
And the test takes the 5 params now required for bio_alloc_bioset()
and passed them into bio_alloc()... which causes the correct code for
5.17 kernels to get patched back out erroneously.

Signed-off-by: Michael D Labriola <veggiemike@sourceruckus.org>
  • Loading branch information
veggiemike authored and chrboe committed Jul 19, 2022
1 parent 2240f77 commit e47c64a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drbd/drbd-kernel-compat/gen_patch_names.c
Expand Up @@ -102,7 +102,7 @@ int main(int argc, char **argv)
#endif

patch(1, "bio_alloc", true, false,
COMPAT_BIO_ALLOC_HAS_5_PARAMS, "has_5_params");
COMPAT_BIO_ALLOC_HAS_4_PARAMS, "has_4_params");

#if !defined(COMPAT_HAVE_BIO_SET_DEV)
patch(1, "bio_set_dev", true, false,
Expand Down
Expand Up @@ -6,7 +6,7 @@
#include <linux/bio.h>

struct bio *foo(struct block_device *bdev, unsigned short nr_vecs,
unsigned int opf, gfp_t gfp_mask, struct bio_set *bs)
unsigned int opf, gfp_t gfp_mask)
{
return bio_alloc(bdev, nr_vecs, opf, gfp_mask, bs);
return bio_alloc(bdev, nr_vecs, opf, gfp_mask);
}

0 comments on commit e47c64a

Please sign in to comment.