From: kernel test robot <lkp@intel.com>
To: Daeho Jeong <daeho43@gmail.com>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Daeho Jeong <daehojeong@google.com>
Subject: Re: [PATCH v2 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl
Date: Thu, 22 Oct 2020 14:50:27 +0800 [thread overview]
Message-ID: <202010221417.kyKRt137-lkp@intel.com> (raw)
In-Reply-To: <20201022035848.976286-2-daeho43@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3924 bytes --]
Hi Daeho,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on f2fs/dev-test]
[also build test WARNING on linus/master v5.9 next-20201022]
[cannot apply to linux/master]
[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]
url: https://github.com/0day-ci/linux/commits/Daeho-Jeong/f2fs-add-F2FS_IOC_GET_COMPRESS_OPTION-ioctl/20201022-115947
base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev-test
config: x86_64-randconfig-a005-20201022 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ee6abef5323d59b983129bf3514ef6775d1d6cd5)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/d869d11ac39edb97c13765c59163d12f56dccd6f
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Daeho-Jeong/f2fs-add-F2FS_IOC_GET_COMPRESS_OPTION-ioctl/20201022-115947
git checkout d869d11ac39edb97c13765c59163d12f56dccd6f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> fs/f2fs/file.c:3997:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (f2fs_is_mmap_file(inode) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/f2fs/file.c:4011:9: note: uninitialized use occurs here
return ret;
^~~
fs/f2fs/file.c:3997:2: note: remove the 'if' if its condition is always true
if (f2fs_is_mmap_file(inode) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/f2fs/file.c:3974:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +3997 fs/f2fs/file.c
3968
3969 static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg)
3970 {
3971 struct inode *inode = file_inode(filp);
3972 struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
3973 struct f2fs_comp_option option;
3974 int ret;
3975
3976 if (!f2fs_sb_has_compression(sbi))
3977 return -EOPNOTSUPP;
3978
3979 if (!f2fs_compressed_file(inode))
3980 return -EINVAL;
3981
3982 if (!(filp->f_mode & FMODE_WRITE))
3983 return -EBADF;
3984
3985 if (copy_from_user(&option, (struct f2fs_comp_option __user *)arg,
3986 sizeof(option)))
3987 return -EFAULT;
3988
3989 if (option.log_cluster_size < MIN_COMPRESS_LOG_SIZE ||
3990 option.log_cluster_size > MAX_COMPRESS_LOG_SIZE ||
3991 !f2fs_is_compress_algorithm_ready(option.algorithm))
3992 return -EINVAL;
3993
3994 file_start_write(filp);
3995 inode_lock(inode);
3996
> 3997 if (f2fs_is_mmap_file(inode) ||
3998 get_dirty_pages(inode) || inode->i_size) {
3999 ret = -EINVAL;
4000 goto out;
4001 }
4002
4003 F2FS_I(inode)->i_compress_algorithm = option.algorithm;
4004 F2FS_I(inode)->i_log_cluster_size = option.log_cluster_size;
4005 F2FS_I(inode)->i_cluster_size = 1 << option.log_cluster_size;
4006 f2fs_mark_inode_dirty_sync(inode, true);
4007 out:
4008 inode_unlock(inode);
4009 file_end_write(filp);
4010
4011 return ret;
4012 }
4013
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34832 bytes --]
next prev parent reply other threads:[~2020-10-22 6:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 3:58 [PATCH v2 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl Daeho Jeong
2020-10-22 3:58 ` [PATCH v2 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl Daeho Jeong
2020-10-22 4:26 ` [f2fs-dev] " Eric Biggers
2020-10-22 4:36 ` Daeho Jeong
2020-10-22 6:50 ` kernel test robot [this message]
2020-10-22 10:14 ` kernel test robot
2020-10-23 12:00 ` Dan Carpenter
2020-10-23 12:03 ` Daeho Jeong
2020-10-22 4:22 ` [f2fs-dev] [PATCH v2 1/2] f2fs: add F2FS_IOC_GET_COMPRESS_OPTION ioctl Eric Biggers
2020-10-22 4:30 ` Daeho Jeong
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=202010221417.kyKRt137-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=daeho43@gmail.com \
--cc=daehojeong@google.com \
--cc=kbuild-all@lists.01.org \
--cc=kernel-team@android.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.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