Re: [PATCH v2 2/9] initramfs_test: kunit tests for initramfs unpacking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-nonmm-unstable]
[also build test ERROR on brauner-vfs/vfs.all linus/master v6.12-rc6 next-20241105]
[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/David-Disseldorp/init-add-initramfs_internal-h/20241104-223438
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link:    https://lore.kernel.org/r/20241104141750.16119-3-ddiss%40suse.de
patch subject: [PATCH v2 2/9] initramfs_test: kunit tests for initramfs unpacking
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20241105/202411051848.VyTNtYY8-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241105/202411051848.VyTNtYY8-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411051848.VyTNtYY8-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   init/initramfs_test.c: In function 'initramfs_test_data':
>> init/initramfs_test.c:210:16: error: implicit declaration of function 'filp_open' [-Werror=implicit-function-declaration]
     210 |         file = filp_open(c[0].fname, O_RDONLY, 0);
         |                ^~~~~~~~~
>> init/initramfs_test.c:210:38: error: 'O_RDONLY' undeclared (first use in this function)
     210 |         file = filp_open(c[0].fname, O_RDONLY, 0);
         |                                      ^~~~~~~~
   init/initramfs_test.c:210:38: note: each undeclared identifier is reported only once for each function it appears in
>> init/initramfs_test.c:217:15: error: implicit declaration of function 'kernel_read'; did you mean 'kref_read'? [-Werror=implicit-function-declaration]
     217 |         len = kernel_read(file, cpio_srcbuf, c[0].filesize, NULL);
         |               ^~~~~~~~~~~
         |               kref_read
   cc1: some warnings being treated as errors


vim +/filp_open +210 init/initramfs_test.c

   176	
   177	static void __init initramfs_test_data(struct kunit *test)
   178	{
   179		char *err, *cpio_srcbuf;
   180		size_t len;
   181		struct file *file;
   182		struct initramfs_test_cpio c[] = { {
   183			.magic = "070701",
   184			.ino = 1,
   185			.mode = S_IFREG | 0777,
   186			.uid = 0,
   187			.gid = 0,
   188			.nlink = 1,
   189			.mtime = 1,
   190			.filesize = sizeof("ASDF") - 1,
   191			.devmajor = 0,
   192			.devminor = 1,
   193			.rdevmajor = 0,
   194			.rdevminor = 0,
   195			.namesize = sizeof("initramfs_test_data"),
   196			.csum = 0,
   197			.fname = "initramfs_test_data",
   198			.data = "ASDF",
   199		} };
   200	
   201		/* +6 for max name and data 4-byte padding */
   202		cpio_srcbuf = kmalloc(CPIO_HDRLEN + c[0].namesize + c[0].filesize + 6,
   203				      GFP_KERNEL);
   204	
   205		len = fill_cpio(c, ARRAY_SIZE(c), cpio_srcbuf);
   206	
   207		err = unpack_to_rootfs(cpio_srcbuf, len);
   208		KUNIT_EXPECT_NULL(test, err);
   209	
 > 210		file = filp_open(c[0].fname, O_RDONLY, 0);
   211		if (!file) {
   212			KUNIT_FAIL(test, "open failed");
   213			goto out;
   214		}
   215	
   216		/* read back file contents into @cpio_srcbuf and confirm match */
 > 217		len = kernel_read(file, cpio_srcbuf, c[0].filesize, NULL);
   218		KUNIT_EXPECT_EQ(test, len, c[0].filesize);
   219		KUNIT_EXPECT_MEMEQ(test, cpio_srcbuf, c[0].data, len);
   220	
   221		fput(file);
   222		KUNIT_EXPECT_EQ(test, init_unlink(c[0].fname), 0);
   223	out:
   224		kfree(cpio_srcbuf);
   225	}
   226	

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux