lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301131203.Fn2TJwNE-lkp@intel.com>
Date:   Fri, 13 Jan 2023 12:24:08 +0800
From:   kernel test robot <lkp@...el.com>
To:     Yangtao Li <frank.li@...o.com>, jaegeuk@...nel.org, chao@...nel.org
Cc:     oe-kbuild-all@...ts.linux.dev,
        linux-f2fs-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, Yangtao Li <frank.li@...o.com>
Subject: Re: [PATCH 2/3] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION_V2 ioctl

Hi Yangtao,

I love your patch! Yet something to improve:

[auto build test ERROR on jaegeuk-f2fs/dev-test]
[also build test ERROR on jaegeuk-f2fs/dev linus/master v6.2-rc3 next-20230112]
[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/Yangtao-Li/f2fs-add-F2FS_IOC_SET_COMPRESS_OPTION_V2-ioctl/20230112-213749
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
patch link:    https://lore.kernel.org/r/20230112133503.16802-1-frank.li%40vivo.com
patch subject: [PATCH 2/3] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION_V2 ioctl
config: i386-randconfig-a003
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/26342f25c972422d5942a4d4a3c57fe2b52c9744
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Yangtao-Li/f2fs-add-F2FS_IOC_SET_COMPRESS_OPTION_V2-ioctl/20230112-213749
        git checkout 26342f25c972422d5942a4d4a3c57fe2b52c9744
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 olddefconfig
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   ld: fs/f2fs/file.o: in function `f2fs_ioc_set_compress_option':
>> fs/f2fs/file.c:3952: undefined reference to `zstd_max_clevel'


vim +3952 fs/f2fs/file.c

  3914	
  3915	static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg,
  3916											unsigned int cmd)
  3917	{
  3918		struct inode *inode = file_inode(filp);
  3919		struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
  3920		struct f2fs_comp_option_v2 option;
  3921		int ret = 0, len;
  3922	
  3923		if (!f2fs_sb_has_compression(sbi))
  3924			return -EOPNOTSUPP;
  3925	
  3926		if (!(filp->f_mode & FMODE_WRITE))
  3927			return -EBADF;
  3928	
  3929		if (cmd == F2FS_IOC_SET_COMPRESS_OPTION_V2)
  3930			len = sizeof(struct f2fs_comp_option_v2);
  3931		else
  3932			len = sizeof(struct f2fs_comp_option);
  3933	
  3934		if (copy_from_user(&option, (void __user *)arg, len))
  3935			return -EFAULT;
  3936	
  3937		if (!f2fs_compressed_file(inode) ||
  3938				option.log_cluster_size < MIN_COMPRESS_LOG_SIZE ||
  3939				option.log_cluster_size > MAX_COMPRESS_LOG_SIZE ||
  3940				option.algorithm >= COMPRESS_MAX)
  3941			return -EINVAL;
  3942	
  3943		if (cmd == F2FS_IOC_SET_COMPRESS_OPTION_V2) {
  3944			unsigned int level = GET_COMPRESS_LEVEL(option.compress_flag);
  3945	
  3946			switch (option.algorithm) {
  3947			case COMPRESS_LZ4:
  3948				if (level < LZ4HC_MIN_CLEVEL || level > LZ4HC_MAX_CLEVEL)
  3949					return -EINVAL;
  3950				break;
  3951			case COMPRESS_ZSTD:
> 3952				if (!level || level > zstd_max_clevel())
  3953					return -EINVAL;
  3954				break;
  3955			}
  3956		}
  3957	
  3958		file_start_write(filp);
  3959		inode_lock(inode);
  3960	
  3961		if (f2fs_is_mmap_file(inode) || get_dirty_pages(inode)) {
  3962			ret = -EBUSY;
  3963			goto out;
  3964		}
  3965	
  3966		if (inode->i_size != 0) {
  3967			ret = -EFBIG;
  3968			goto out;
  3969		}
  3970	
  3971		F2FS_I(inode)->i_compress_algorithm = option.algorithm;
  3972		F2FS_I(inode)->i_log_cluster_size = option.log_cluster_size;
  3973		F2FS_I(inode)->i_cluster_size = BIT(option.log_cluster_size);
  3974	
  3975		if (cmd == F2FS_IOC_SET_COMPRESS_OPTION_V2)
  3976			F2FS_I(inode)->i_compress_flag = option.compress_flag & COMPRESS_OPTION_MASK;
  3977		f2fs_mark_inode_dirty_sync(inode, true);
  3978	
  3979		if (!f2fs_is_compress_backend_ready(inode))
  3980			f2fs_warn(sbi, "compression algorithm is successfully set, "
  3981				"but current kernel doesn't support this algorithm.");
  3982	out:
  3983		inode_unlock(inode);
  3984		file_end_write(filp);
  3985	
  3986		return ret;
  3987	}
  3988	

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

View attachment "config" of type "text/plain" (159725 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ