All of lore.kernel.org
 help / color / mirror / Atom feed
* [chao:feature/subpage 5/10] include/linux/f2fs_fs.h:347:24: error: flexible array member in union
@ 2026-08-30 11:47 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 11:47 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: 0afae9798e90aeeeebfaaf8878c16c2a5f1dbc9f [5/10] f2fs: describe {i,d,id}node block layout dynamically
config: m68k-randconfig-r072-20260830 (https://download.01.org/0day-ci/archive/20260830/202608301900.19vrzwch-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/202608301900.19vrzwch-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/202608301900.19vrzwch-lkp@intel.com/

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

   In file included from fs/f2fs/dir.c:10:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   In file included from fs/f2fs/dir.c:15:
   fs/f2fs/f2fs.h: In function 'blkaddr_in_node':
>> fs/f2fs/f2fs.h:3314:1: warning: control reaches end of non-void function [-Wreturn-type]
    3314 | }
         | ^
--
   In file included from fs/f2fs/namei.c:9:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
--
   In file included from fs/f2fs/node.c:9:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   In file included from fs/f2fs/node.c:18:
   fs/f2fs/node.h: In function 'get_nid':
>> fs/f2fs/node.h:395:1: warning: control reaches end of non-void function [-Wreturn-type]
     395 | }
         | ^
   In file included from fs/f2fs/node.c:17:
   fs/f2fs/f2fs.h: In function 'blkaddr_in_node':
>> fs/f2fs/f2fs.h:3314:1: warning: control reaches end of non-void function [-Wreturn-type]
    3314 | }
         | ^
   fs/f2fs/f2fs.h: In function 'inline_xattr_addr':
   fs/f2fs/f2fs.h:3660:1: warning: control reaches end of non-void function [-Wreturn-type]
    3660 | }
         | ^
--
   In file included from fs/f2fs/segment.c:9:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         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 fs/f2fs/segment.c:22:
   fs/f2fs/f2fs.h: In function 'blkaddr_in_node':
>> fs/f2fs/f2fs.h:3314:1: warning: control reaches end of non-void function [-Wreturn-type]
    3314 | }
         | ^
--
   In file included from fs/f2fs/xattr.c:19:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   In file included from fs/f2fs/xattr.c:23:
   fs/f2fs/f2fs.h: In function 'inline_xattr_addr':
   fs/f2fs/f2fs.h:3660:1: warning: control reaches end of non-void function [-Wreturn-type]
    3660 | }
         | ^
--
   In file included from f2fs/dir.c:10:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   In file included from f2fs/dir.c:15:
   f2fs/f2fs.h: In function 'blkaddr_in_node':
   f2fs/f2fs.h:3314:1: warning: control reaches end of non-void function [-Wreturn-type]
    3314 | }
         | ^
--
   In file included from f2fs/node.c:9:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   In file included from f2fs/node.c:18:
   f2fs/node.h: In function 'get_nid':
   f2fs/node.h:395:1: warning: control reaches end of non-void function [-Wreturn-type]
     395 | }
         | ^
   In file included from f2fs/node.c:17:
   f2fs/f2fs.h: In function 'blkaddr_in_node':
   f2fs/f2fs.h:3314:1: warning: control reaches end of non-void function [-Wreturn-type]
    3314 | }
         | ^
   f2fs/f2fs.h: In function 'inline_xattr_addr':
   f2fs/f2fs.h:3660:1: warning: control reaches end of non-void function [-Wreturn-type]
    3660 | }
         | ^
--
   In file included from f2fs/segment.c:9:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         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;
         |                                     ^~~~~~~~~~
   In file included from f2fs/segment.c:22:
   f2fs/f2fs.h: In function 'blkaddr_in_node':
   f2fs/f2fs.h:3314:1: warning: control reaches end of non-void function [-Wreturn-type]
    3314 | }
         | ^
--
   In file included from f2fs/xattr.c:19:
>> include/linux/f2fs_fs.h:347:24: error: flexible array member in union
     347 |                 __le32 i_addr[];                /* data block pointers */
         |                        ^~~~~~
   include/linux/f2fs_fs.h:360:16: error: flexible array member in a struct with no named members
     360 |         __le32 addr[];                  /* array of data block address */
         |                ^~~~
   include/linux/f2fs_fs.h:365:16: error: flexible array member in a struct with no named members
     365 |         __le32 nid[];                   /* array of data block address */
         |                ^~~
   include/linux/f2fs_fs.h:404:31: error: flexible array member in a struct with no named members
     404 |         struct f2fs_nat_entry entries[];
         |                               ^~~~~~~
   include/linux/f2fs_fs.h:448:31: error: flexible array member in a struct with no named members
     448 |         struct f2fs_sit_entry entries[];
         |                               ^~~~~~~
   In file included from f2fs/xattr.c:23:
   f2fs/f2fs.h: In function 'inline_xattr_addr':
   f2fs/f2fs.h:3660:1: warning: control reaches end of non-void function [-Wreturn-type]
    3660 | }
         | ^


vim +347 include/linux/f2fs_fs.h

   297	
   298	struct f2fs_inode {
   299		__le16 i_mode;			/* file mode */
   300		__u8 i_advise;			/* file hints */
   301		__u8 i_inline;			/* file inline flags */
   302		__le32 i_uid;			/* user ID */
   303		__le32 i_gid;			/* group ID */
   304		__le32 i_links;			/* links count */
   305		__le64 i_size;			/* file size in bytes */
   306		__le64 i_blocks;		/* file size in blocks */
   307		__le64 i_atime;			/* access time */
   308		__le64 i_ctime;			/* change time */
   309		__le64 i_mtime;			/* modification time */
   310		__le32 i_atime_nsec;		/* access time in nano scale */
   311		__le32 i_ctime_nsec;		/* change time in nano scale */
   312		__le32 i_mtime_nsec;		/* modification time in nano scale */
   313		__le32 i_generation;		/* file version (for NFS) */
   314		union {
   315			__le32 i_current_depth;	/* only for directory depth */
   316			__le16 i_gc_failures;	/*
   317						 * # of gc failures on pinned file.
   318						 * only for regular files.
   319						 */
   320		};
   321		__le32 i_xattr_nid;		/* nid to save xattr */
   322		__le32 i_flags;			/* file attributes */
   323		__le32 i_pino;			/* parent inode number */
   324		__le32 i_namelen;		/* file name length */
   325		__u8 i_name[F2FS_NAME_LEN];	/* file name for SPOR */
   326		__u8 i_dir_level;		/* dentry_level for large dir */
   327	
   328		struct f2fs_extent i_ext;	/* caching a largest extent */
   329	
   330		union {
   331			struct {
   332				__le16 i_extra_isize;	/* extra inode attribute size */
   333				__le16 i_inline_xattr_size;	/* inline xattr size, unit: 4 bytes */
   334				__le32 i_projid;	/* project id */
   335				__le32 i_inode_checksum;/* inode meta checksum */
   336				__le64 i_crtime;	/* creation time */
   337				__le32 i_crtime_nsec;	/* creation time in nano scale */
   338				__le64 i_compr_blocks;	/* # of compressed blocks */
   339				__u8 i_compress_algorithm;	/* compress algorithm */
   340				__u8 i_log_cluster_size;	/* log of cluster size */
   341				__le16 i_compress_flag;		/* compress flag */
   342							/* 0 bit: chksum flag
   343							 * [8,15] bits: compress level
   344							 */
   345				__le32 i_extra_end[0];	/* for attribute size calculation */
   346			} __packed;
 > 347			__le32 i_addr[];		/* data block pointers */
   348		};
   349		/*
   350		 * __le32 i_nid[DEF_NIDS_PER_INODE];
   351		 *
   352		 * It is stored immediately before the node footer at the end of the
   353		 * filesystem block. Its offset depends on the filesystem block size, so
   354		 * locate it dynamically with F2FS_INODE_NIDS().
   355		 */
   356	} __packed;
   357	

--
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 5/10] include/linux/f2fs_fs.h:347:24: error: flexible array member in union
  2026-08-30 11:47 [chao:feature/subpage 5/10] include/linux/f2fs_fs.h:347:24: error: flexible array member in union 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 has the same root cause as the earlier SIT report. Flexible array
members that are alone in a struct or used in a union now use
DECLARE_FLEX_ARRAY(), including the inode address array,
direct/indirect node arrays, and NAT/SIT entry arrays. The changes are
folded into their respective patches for the next revision.

A W=1 m68k build at the reported node-layout patch now completes successfully.

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 11:47 [chao:feature/subpage 5/10] include/linux/f2fs_fs.h:347:24: error: flexible array member in union 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.