All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, Chao Yu <yuchao0@huawei.com>,
	Chao Yu <chao@kernel.org>, Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [chao:dev-test 1/21] fs/f2fs/file.c:1941:37: warning: statement with no effect
Date: Sun, 25 Jun 2023 19:02:00 +0800	[thread overview]
Message-ID: <202306251856.GIweOxME-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git dev-test
head:   e0494cc29d5285433cd8a5b0d79a84c1e57ca339
commit: ffda111162ddf40c7544c6412ddac9b8494ca3e7 [1/21] f2fs: fix to avoid mmap vs set_compress_option case
config: i386-randconfig-i003-20230625 (https://download.01.org/0day-ci/archive/20230625/202306251856.GIweOxME-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230625/202306251856.GIweOxME-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/202306251856.GIweOxME-lkp@intel.com/

All warnings (new ones prefixed by >>):

   fs/f2fs/file.c: In function 'f2fs_setflags_common':
>> fs/f2fs/file.c:1941:37: warning: statement with no effect [-Wunused-value]
    1941 |                                 err -EOPNOTSUPP;


vim +1941 fs/f2fs/file.c

  1896	
  1897	static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
  1898	{
  1899		struct f2fs_inode_info *fi = F2FS_I(inode);
  1900		u32 masked_flags = fi->i_flags & mask;
  1901	
  1902		/* mask can be shrunk by flags_valid selector */
  1903		iflags &= mask;
  1904	
  1905		/* Is it quota file? Do not allow user to mess with it */
  1906		if (IS_NOQUOTA(inode))
  1907			return -EPERM;
  1908	
  1909		if ((iflags ^ masked_flags) & F2FS_CASEFOLD_FL) {
  1910			if (!f2fs_sb_has_casefold(F2FS_I_SB(inode)))
  1911				return -EOPNOTSUPP;
  1912			if (!f2fs_empty_dir(inode))
  1913				return -ENOTEMPTY;
  1914		}
  1915	
  1916		if (iflags & (F2FS_COMPR_FL | F2FS_NOCOMP_FL)) {
  1917			if (!f2fs_sb_has_compression(F2FS_I_SB(inode)))
  1918				return -EOPNOTSUPP;
  1919			if ((iflags & F2FS_COMPR_FL) && (iflags & F2FS_NOCOMP_FL))
  1920				return -EINVAL;
  1921		}
  1922	
  1923		if ((iflags ^ masked_flags) & F2FS_COMPR_FL) {
  1924			if (masked_flags & F2FS_COMPR_FL) {
  1925				if (!f2fs_disable_compressed_file(inode))
  1926					return -EINVAL;
  1927			} else {
  1928				/* try to convert inline_data to support compression */
  1929				int err = f2fs_convert_inline_inode(inode);
  1930				if (err)
  1931					return err;
  1932	
  1933				f2fs_down_write(&F2FS_I(inode)->i_sem);
  1934				if (!f2fs_may_compress(inode) ||
  1935						(S_ISREG(inode->i_mode) &&
  1936						F2FS_HAS_BLOCKS(inode))) {
  1937					f2fs_up_write(&F2FS_I(inode)->i_sem);
  1938					return -EINVAL;
  1939				}
  1940				if (set_compress_context(inode))
> 1941					err -EOPNOTSUPP;
  1942				f2fs_up_write(&F2FS_I(inode)->i_sem);
  1943	
  1944				if (err)
  1945					return err;
  1946			}
  1947		}
  1948	
  1949		fi->i_flags = iflags | (fi->i_flags & ~mask);
  1950		f2fs_bug_on(F2FS_I_SB(inode), (fi->i_flags & F2FS_COMPR_FL) &&
  1951						(fi->i_flags & F2FS_NOCOMP_FL));
  1952	
  1953		if (fi->i_flags & F2FS_PROJINHERIT_FL)
  1954			set_inode_flag(inode, FI_PROJ_INHERIT);
  1955		else
  1956			clear_inode_flag(inode, FI_PROJ_INHERIT);
  1957	
  1958		inode->i_ctime = current_time(inode);
  1959		f2fs_set_inode_flags(inode);
  1960		f2fs_mark_inode_dirty_sync(inode, true);
  1961		return 0;
  1962	}
  1963	

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

                 reply	other threads:[~2023-06-25 11:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202306251856.GIweOxME-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yuchao0@huawei.com \
    /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 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.