All of lore.kernel.org
 help / color / mirror / Atom feed
* [chao:feature/subpage 1/10] include/linux/f2fs_fs.h:431:31: error: flexible array member in a struct with no named members
@ 2026-08-30  8:09 kernel test robot
  2026-08-31  4:58 ` Xinping Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2026-08-30  8:09 UTC (permalink / raw)
  To: Kelvin Zhang; +Cc: oe-kbuild-all, Chao Yu

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git feature/subpage
head:   3a537197e7b9327a386b4c5deab273a387072d1f
commit: c2b3b99e814a6c70d1498fbd92d0d459901fc876 [1/10] f2fs: describe SIT block layout dynamically
config: m68k-randconfig-r072-20260830 (https://download.01.org/0day-ci/archive/20260830/202608301649.G22k4ucE-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.5.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260830/202608301649.G22k4ucE-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/202608301649.G22k4ucE-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from fs/f2fs/dir.c:10:
>> include/linux/f2fs_fs.h:431:31: error: flexible array member in a struct with no named members
     431 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
--
   In file included from fs/f2fs/segment.c:9:
>> include/linux/f2fs_fs.h:431:31: error: flexible array member in a struct with no named members
     431 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   fs/f2fs/segment.c: In function 'f2fs_flush_sit_entries':
>> fs/f2fs/segment.c:4865:37: warning: variable 'sit_offset' set but not used [-Wunused-but-set-variable]
    4865 |                         int offset, sit_offset;
         |                                     ^~~~~~~~~~
--
   In file included from f2fs/segment.c:9:
>> include/linux/f2fs_fs.h:431:31: error: flexible array member in a struct with no named members
     431 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   f2fs/segment.c: In function 'f2fs_flush_sit_entries':
   f2fs/segment.c:4865:37: warning: variable 'sit_offset' set but not used [-Wunused-but-set-variable]
    4865 |                         int offset, sit_offset;
         |                                     ^~~~~~~~~~


vim +431 include/linux/f2fs_fs.h

   424	
   425	/*
   426	 * The on-disk SIT block is a filesystem-block-sized array of SIT entries.
   427	 * Its entry count depends on the filesystem block size, so it must be
   428	 * calculated by the caller rather than implied by this C structure.
   429	 */
   430	struct f2fs_sit_block {
 > 431		struct f2fs_sit_entry entries[];
   432	} __packed;
   433	

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

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

* Re: [chao:feature/subpage 1/10] include/linux/f2fs_fs.h:431:31: error: flexible array member in a struct with no named members
  2026-08-30  8:09 [chao:feature/subpage 1/10] include/linux/f2fs_fs.h:431:31: error: flexible array member in a struct with no named members kernel test robot
@ 2026-08-31  4:58 ` Xinping Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Xinping Zhang @ 2026-08-31  4:58 UTC (permalink / raw)
  To: kernel test robot; +Cc: oe-kbuild-all, Chao Yu

Thanks for the report.

This is fixed by using DECLARE_FLEX_ARRAY(struct f2fs_sit_entry,
entries) for struct f2fs_sit_block. I folded the fix into "f2fs:
describe SIT block layout dynamically" for the next revision.

I also rebuilt fs/f2fs/ with the reported m68k randconfig, and the
flexible-array error is gone.

Thanks,
Kelvin

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

end of thread, other threads:[~2026-08-31  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-30  8:09 [chao:feature/subpage 1/10] include/linux/f2fs_fs.h:431:31: error: flexible array member in a struct with no named members kernel test robot
2026-08-31  4:58 ` Xinping Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.