public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] block: Use struct_size() helper in kmalloc()
@ 2026-03-06  8:00 luoqing
  2026-03-06 15:52 ` kernel test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: luoqing @ 2026-03-06  8:00 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel

From: luoqing <luoqing@kylinos.cn>

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worst scenario, could lead to heap overflows.

Signed-off-by: luoqing <luoqing@kylinos.cn>
---
 block/bio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index d80d5d26804e..397fc3bc0ede 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -657,8 +657,7 @@ struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
 
 	if (nr_vecs > BIO_MAX_INLINE_VECS)
 		return NULL;
-	return kmalloc(sizeof(*bio) + nr_vecs * sizeof(struct bio_vec),
-			gfp_mask);
+	return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
 }
 EXPORT_SYMBOL(bio_kmalloc);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
  2026-03-06  8:00 [PATCH 1/2] block: Use struct_size() helper in kmalloc() luoqing
@ 2026-03-06 15:52 ` kernel test robot
  2026-03-06 16:02 ` kernel test robot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-03-06 15:52 UTC (permalink / raw)
  To: luoqing, axboe; +Cc: oe-kbuild-all, linux-block, linux-kernel

Hi luoqing,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe/for-next]
[also build test ERROR on device-mapper-dm/for-next next-20260305]
[cannot apply to linus/master v6.16-rc1]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/luoqing/dm-bufio-Use-struct_size-helper-in-kmalloc/20260306-165625
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link:    https://lore.kernel.org/r/20260306080056.1262324-1-l1138897701%40163.com
patch subject: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
config: x86_64-rhel-9.4-ltp (https://download.01.org/0day-ci/archive/20260306/202603061605.8Q7r4bnr-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260306/202603061605.8Q7r4bnr-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603061605.8Q7r4bnr-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/percpu.h:5,
                    from arch/x86/include/asm/msr.h:16,
                    from arch/x86/include/asm/tsc.h:11,
                    from arch/x86/include/asm/timex.h:6,
                    from include/linux/timex.h:67,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/jiffies.h:10,
                    from include/linux/ktime.h:25,
                    from include/linux/timer.h:6,
                    from include/linux/uprobes.h:18,
                    from include/linux/mm_types.h:16,
                    from include/linux/mmzone.h:22,
                    from include/linux/gfp.h:7,
                    from include/linux/mm.h:8,
                    from block/bio.c:5:
   block/bio.c: In function 'bio_kmalloc':
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);


vim +660 block/bio.c

   637	
   638	/**
   639	 * bio_kmalloc - kmalloc a bio
   640	 * @nr_vecs:	number of bio_vecs to allocate
   641	 * @gfp_mask:   the GFP_* mask given to the slab allocator
   642	 *
   643	 * Use kmalloc to allocate a bio (including bvecs).  The bio must be initialized
   644	 * using bio_init() before use.  To free a bio returned from this function use
   645	 * kfree() after calling bio_uninit().  A bio returned from this function can
   646	 * be reused by calling bio_uninit() before calling bio_init() again.
   647	 *
   648	 * Note that unlike bio_alloc() or bio_alloc_bioset() allocations from this
   649	 * function are not backed by a mempool can fail.  Do not use this function
   650	 * for allocations in the file system I/O path.
   651	 *
   652	 * Returns: Pointer to new bio on success, NULL on failure.
   653	 */
   654	struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
   655	{
   656		struct bio *bio;
   657	
   658		if (nr_vecs > BIO_MAX_INLINE_VECS)
   659			return NULL;
 > 660		return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
   661	}
   662	EXPORT_SYMBOL(bio_kmalloc);
   663	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
  2026-03-06  8:00 [PATCH 1/2] block: Use struct_size() helper in kmalloc() luoqing
  2026-03-06 15:52 ` kernel test robot
@ 2026-03-06 16:02 ` kernel test robot
  2026-03-06 18:34 ` kernel test robot
  2026-03-06 19:07 ` kernel test robot
  3 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-03-06 16:02 UTC (permalink / raw)
  To: luoqing, axboe; +Cc: llvm, oe-kbuild-all, linux-block, linux-kernel

Hi luoqing,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe/for-next]
[also build test ERROR on device-mapper-dm/for-next linus/master v7.0-rc2 next-20260305]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/luoqing/dm-bufio-Use-struct_size-helper-in-kmalloc/20260306-165625
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link:    https://lore.kernel.org/r/20260306080056.1262324-1-l1138897701%40163.com
patch subject: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260306/202603061636.1njuAoiZ-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260306/202603061636.1njuAoiZ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603061636.1njuAoiZ-lkp@intel.com/

All errors (new ones prefixed by >>):

>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:26: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                        ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:436:18: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^
   include/linux/overflow.h:420:36: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:421:32: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                              ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:436:18: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^
   include/linux/overflow.h:421:42: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:420:26: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                        ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:437:26: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^
   include/linux/overflow.h:420:36: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:421:32: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                              ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:437:26: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^
   include/linux/overflow.h:421:42: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:26: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                        ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:255:10: note: expanded from macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:255:10: note: expanded from macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:255:10: note: expanded from macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.


vim +660 block/bio.c

   637	
   638	/**
   639	 * bio_kmalloc - kmalloc a bio
   640	 * @nr_vecs:	number of bio_vecs to allocate
   641	 * @gfp_mask:   the GFP_* mask given to the slab allocator
   642	 *
   643	 * Use kmalloc to allocate a bio (including bvecs).  The bio must be initialized
   644	 * using bio_init() before use.  To free a bio returned from this function use
   645	 * kfree() after calling bio_uninit().  A bio returned from this function can
   646	 * be reused by calling bio_uninit() before calling bio_init() again.
   647	 *
   648	 * Note that unlike bio_alloc() or bio_alloc_bioset() allocations from this
   649	 * function are not backed by a mempool can fail.  Do not use this function
   650	 * for allocations in the file system I/O path.
   651	 *
   652	 * Returns: Pointer to new bio on success, NULL on failure.
   653	 */
   654	struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
   655	{
   656		struct bio *bio;
   657	
   658		if (nr_vecs > BIO_MAX_INLINE_VECS)
   659			return NULL;
 > 660		return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
   661	}
   662	EXPORT_SYMBOL(bio_kmalloc);
   663	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
  2026-03-06  8:00 [PATCH 1/2] block: Use struct_size() helper in kmalloc() luoqing
  2026-03-06 15:52 ` kernel test robot
  2026-03-06 16:02 ` kernel test robot
@ 2026-03-06 18:34 ` kernel test robot
  2026-03-06 19:07 ` kernel test robot
  3 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-03-06 18:34 UTC (permalink / raw)
  To: luoqing, axboe; +Cc: llvm, oe-kbuild-all, linux-block, linux-kernel

Hi luoqing,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe/for-next]
[also build test ERROR on device-mapper-dm/for-next linus/master v7.0-rc2 next-20260306]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/luoqing/dm-bufio-Use-struct_size-helper-in-kmalloc/20260306-165625
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link:    https://lore.kernel.org/r/20260306080056.1262324-1-l1138897701%40163.com
patch subject: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20260307/202603070226.gVmbTzRU-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260307/202603070226.gVmbTzRU-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603070226.gVmbTzRU-lkp@intel.com/

All errors (new ones prefixed by >>):

   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:26: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                        ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:436:18: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^
   include/linux/overflow.h:420:36: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:421:32: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                              ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:436:18: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^
   include/linux/overflow.h:421:42: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:420:26: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                        ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:437:26: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^
   include/linux/overflow.h:420:36: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:421:32: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                              ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:437:45: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                                           ^
   include/linux/overflow.h:421:63: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                             ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
>> block/bio.c:660:17: error: static assertion failed due to requirement '!(!(!__builtin_types_compatible_p(struct bio_vec *, struct bio_vec *)))': must be array
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:437:26: note: expanded from macro 'struct_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^
   include/linux/overflow.h:421:42: note: expanded from macro 'flex_array_size'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^
   include/linux/compiler.h:208:28: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
   include/linux/alloc_tag.h:251:9: note: expanded from macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:26: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                        ^
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:255:10: note: expanded from macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:255:10: note: expanded from macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   block/bio.c:660:34: error: no member named 'bio_vec' in 'struct bio'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
         |                                         bi_io_vec
   include/linux/overflow.h:436:37: note: expanded from macro 'struct_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                                   ^
   include/linux/overflow.h:420:57: note: expanded from macro 'flex_array_size'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                       ^
   include/linux/compiler.h:208:64: note: expanded from macro '__must_be_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                                     ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/slab.h:956:52: note: expanded from macro 'kmalloc'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                                            ^
   include/linux/alloc_tag.h:265:31: note: expanded from macro 'alloc_hooks'
     265 |         alloc_hooks_tag(&_alloc_tag, _do_alloc);                        \
         |                                      ^
   include/linux/alloc_tag.h:255:10: note: expanded from macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^
   include/linux/blk_types.h:236:19: note: 'bi_io_vec' declared here
     236 |         struct bio_vec          *bi_io_vec;
         |                                  ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.


vim +660 block/bio.c

   637	
   638	/**
   639	 * bio_kmalloc - kmalloc a bio
   640	 * @nr_vecs:	number of bio_vecs to allocate
   641	 * @gfp_mask:   the GFP_* mask given to the slab allocator
   642	 *
   643	 * Use kmalloc to allocate a bio (including bvecs).  The bio must be initialized
   644	 * using bio_init() before use.  To free a bio returned from this function use
   645	 * kfree() after calling bio_uninit().  A bio returned from this function can
   646	 * be reused by calling bio_uninit() before calling bio_init() again.
   647	 *
   648	 * Note that unlike bio_alloc() or bio_alloc_bioset() allocations from this
   649	 * function are not backed by a mempool can fail.  Do not use this function
   650	 * for allocations in the file system I/O path.
   651	 *
   652	 * Returns: Pointer to new bio on success, NULL on failure.
   653	 */
   654	struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
   655	{
   656		struct bio *bio;
   657	
   658		if (nr_vecs > BIO_MAX_INLINE_VECS)
   659			return NULL;
 > 660		return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
   661	}
   662	EXPORT_SYMBOL(bio_kmalloc);
   663	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
  2026-03-06  8:00 [PATCH 1/2] block: Use struct_size() helper in kmalloc() luoqing
                   ` (2 preceding siblings ...)
  2026-03-06 18:34 ` kernel test robot
@ 2026-03-06 19:07 ` kernel test robot
  3 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-03-06 19:07 UTC (permalink / raw)
  To: luoqing, axboe; +Cc: oe-kbuild-all, linux-block, linux-kernel

Hi luoqing,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe/for-next]
[also build test ERROR on device-mapper-dm/for-next linus/master v7.0-rc2 next-20260306]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/luoqing/dm-bufio-Use-struct_size-helper-in-kmalloc/20260306-165625
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link:    https://lore.kernel.org/r/20260306080056.1262324-1-l1138897701%40163.com
patch subject: [PATCH 1/2] block: Use struct_size() helper in kmalloc()
config: alpha-allnoconfig (https://download.01.org/0day-ci/archive/20260307/202603070229.0LteZRkh-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260307/202603070229.0LteZRkh-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603070229.0LteZRkh-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/workqueue.h:9,
                    from include/linux/mm_types.h:19,
                    from include/linux/mmzone.h:22,
                    from include/linux/gfp.h:7,
                    from include/linux/mm.h:8,
                    from block/bio.c:5:
   block/bio.c: In function 'bio_kmalloc':
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:437:40: note: in expansion of macro 'flex_array_size'
     437 |                 size_add(sizeof(*(p)), flex_array_size(p, member, count)))
         |                                        ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
>> include/linux/compiler.h:203:82: error: expression in static assertion is not an integer
     203 | #define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
         |                                                                                  ^
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:420:50: note: in expansion of macro '__must_be_array'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                        ^~~~~~~~~~~
   block/bio.c:660:41: error: 'struct bio' has no member named 'bio_vec'; did you mean 'bi_io_vec'?
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                                         ^~~~~~~
   include/linux/alloc_tag.h:255:24: note: in definition of macro 'alloc_hooks_tag'
     255 |                 _res = _do_alloc;                                       \
         |                        ^~~~~~~~~
   include/linux/slab.h:956:49: note: in expansion of macro 'alloc_hooks'
     956 | #define kmalloc(...)                            alloc_hooks(kmalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   block/bio.c:660:16: note: in expansion of macro 'kmalloc'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
         |                ^~~~~~~
   include/linux/compiler.h:208:33: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                 ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:207:35: note: in expansion of macro '__same_type'
     207 | #define __is_array(a)           (!__same_type((a), &(a)[0]))
         |                                   ^~~~~~~~~~~
   include/linux/compiler.h:208:58: note: in expansion of macro '__is_array'
     208 | #define __must_be_array(a)      __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
         |                                                          ^~~~~~~~~~
   include/linux/overflow.h:421:56: note: in expansion of macro '__must_be_array'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ^~~~~~~~~~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   block/bio.c:660:24: note: in expansion of macro 'struct_size'
     660 |         return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);


vim +660 block/bio.c

   637	
   638	/**
   639	 * bio_kmalloc - kmalloc a bio
   640	 * @nr_vecs:	number of bio_vecs to allocate
   641	 * @gfp_mask:   the GFP_* mask given to the slab allocator
   642	 *
   643	 * Use kmalloc to allocate a bio (including bvecs).  The bio must be initialized
   644	 * using bio_init() before use.  To free a bio returned from this function use
   645	 * kfree() after calling bio_uninit().  A bio returned from this function can
   646	 * be reused by calling bio_uninit() before calling bio_init() again.
   647	 *
   648	 * Note that unlike bio_alloc() or bio_alloc_bioset() allocations from this
   649	 * function are not backed by a mempool can fail.  Do not use this function
   650	 * for allocations in the file system I/O path.
   651	 *
   652	 * Returns: Pointer to new bio on success, NULL on failure.
   653	 */
   654	struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
   655	{
   656		struct bio *bio;
   657	
   658		if (nr_vecs > BIO_MAX_INLINE_VECS)
   659			return NULL;
 > 660		return kmalloc(struct_size(bio, bio_vec, nr_vecs), gfp_mask);
   661	}
   662	EXPORT_SYMBOL(bio_kmalloc);
   663	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-06 19:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06  8:00 [PATCH 1/2] block: Use struct_size() helper in kmalloc() luoqing
2026-03-06 15:52 ` kernel test robot
2026-03-06 16:02 ` kernel test robot
2026-03-06 18:34 ` kernel test robot
2026-03-06 19:07 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox