mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: luoqing <l1138897701@163.com>, agk@redhat.com
Cc: oe-kbuild-all@lists.linux.dev, snitzer@kernel.org,
	dm-devel@lists.linux.dev, mpatocka@redhat.com,
	bmarzins@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] dm-bufio: Use struct_size() helper in kmalloc()
Date: Sat, 7 Mar 2026 03:07:55 +0800	[thread overview]
Message-ID: <202603070341.J8qZJaCg-lkp@intel.com> (raw)
In-Reply-To: <20260306080257.1268206-1-l1138897701@163.com>

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/20260306080257.1268206-1-l1138897701%40163.com
patch subject: [PATCH 2/2] dm-bufio: Use struct_size() helper in kmalloc()
config: m68k-defconfig (https://download.01.org/0day-ci/archive/20260307/202603070341.J8qZJaCg-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260307/202603070341.J8qZJaCg-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/202603070341.J8qZJaCg-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/xarray.h:16,
                    from include/linux/list_lru.h:14,
                    from include/linux/fs/super_types.h:7,
                    from include/linux/fs/super.h:5,
                    from include/linux/fs.h:5,
                    from include/linux/highmem.h:5,
                    from include/linux/bvec.h:10,
                    from include/linux/blk_types.h:10,
                    from include/linux/blkdev.h:9,
                    from include/linux/dm-bufio.h:13,
                    from drivers/md/dm-bufio.c:10:
   drivers/md/dm-bufio.c: In function 'dm_bufio_client_create':
>> include/linux/overflow.h:420:38: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                      ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   include/linux/overflow.h:420:69: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                     ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   include/linux/overflow.h:420:69: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                     ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   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:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
--
         |                                            ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   include/linux/overflow.h:436:32: note: in expansion of macro 'flex_array_size'
     436 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   include/linux/overflow.h:421:75: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                           ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   include/linux/overflow.h:421:75: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     421 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                                           ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   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:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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),       \
         |                                ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
>> include/linux/overflow.h:420:38: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                      ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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)))
         |                                        ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   include/linux/overflow.h:420:69: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                     ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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)))
         |                                        ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   include/linux/overflow.h:420:69: error: 'struct dm_bufio_client' has no member named 'buffer_tree'
     420 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                                     ^~
   include/linux/alloc_tag.h:251:16: note: in definition of macro 'alloc_hooks_tag'
     251 |         typeof(_do_alloc) _res;                                         \
         |                ^~~~~~~~~
   include/linux/slab.h:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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)))
         |                                        ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |                     ^~~~~~~~~~~
   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:1190:49: note: in expansion of macro 'alloc_hooks'
    1190 | #define kzalloc(...)                            alloc_hooks(kzalloc_noprof(__VA_ARGS__))
         |                                                 ^~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:13: note: in expansion of macro 'kzalloc'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
         |             ^~~~~~~
   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)))
         |                                        ^~~~~~~~~~~~~~~
   drivers/md/dm-bufio.c:2514:21: note: in expansion of macro 'struct_size'
    2514 |         c = kzalloc(struct_size(c, buffer_tree, num_locks), GFP_KERNEL);
..


vim +420 include/linux/overflow.h

610b15c50e86eb1 Kees Cook           2018-05-07  405  
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  406  /**
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  407   * flex_array_size() - Calculate size of a flexible array member
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  408   *                     within an enclosing structure.
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  409   * @p: Pointer to the structure.
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  410   * @member: Name of the flexible array member.
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  411   * @count: Number of elements in the array.
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  412   *
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  413   * Calculates size of a flexible array of @count number of @member
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  414   * elements, at the end of structure @p.
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  415   *
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  416   * Return: number of bytes needed or SIZE_MAX on overflow.
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  417   */
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  418  #define flex_array_size(p, member, count)				\
230f6fa2c1db6a3 Kees Cook           2022-02-09  419  	__builtin_choose_expr(__is_constexpr(count),			\
230f6fa2c1db6a3 Kees Cook           2022-02-09 @420  		(count) * sizeof(*(p)->member) + __must_be_array((p)->member),	\
230f6fa2c1db6a3 Kees Cook           2022-02-09  421  		size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
b19d57d0f3cc6f1 Gustavo A. R. Silva 2020-06-08  422  

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

  parent reply	other threads:[~2026-03-06 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  8:02 luoqing
2026-03-06 17:14 ` kernel test robot
2026-03-06 19:07 ` kernel test robot [this message]
2026-03-06 23:47 ` Benjamin Marzinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202603070341.J8qZJaCg-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=l1138897701@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=snitzer@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®