All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [linux-next:master 4982/5794] fs/f2fs/file.c:2524 __f2fs_ioc_gc_range() warn: inconsistent returns 'sbi->gc_lock'.
Date: Sat, 14 Nov 2020 19:25:26 +0800	[thread overview]
Message-ID: <202011141922.DzfAzSYO-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4835 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Chao Yu <yuchao0@huawei.com>, Chao Yu <chao@kernel.org>
CC: Jaegeuk Kim <jaegeuk@kernel.org>
CC: Eric Biggers <ebiggers@google.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   92edc4aef86780a8ad01b092c6d6630bb3cb423d
commit: ea7b72e05309d579b9c2d5d74a352e41c7ed71ec [4982/5794] f2fs: fix compat F2FS_IOC_{MOVE,GARBAGE_COLLECT}_RANGE
:::::: branch date: 28 hours ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-m001-20201113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
fs/f2fs/file.c:2524 __f2fs_ioc_gc_range() warn: inconsistent returns 'sbi->gc_lock'.

Old smatch warnings:
fs/f2fs/f2fs.h:2032 dec_valid_block_count() warn: should 'count << 3' be a 64 bit type?
fs/f2fs/file.c:2950 f2fs_ioc_flush_device() warn: potential spectre issue 'sbi->devs' [w] (local cap)
fs/f2fs/file.c:2975 f2fs_ioc_flush_device() warn: inconsistent returns 'sbi->gc_lock'.
fs/f2fs/file.c:3314 f2fs_precache_extents() error: uninitialized symbol 'err'.

vim +2524 fs/f2fs/file.c

c1c1b58359d45e Chao Yu         2015-07-10  2482  
ea7b72e05309d5 Chao Yu         2020-11-10  2483  static int __f2fs_ioc_gc_range(struct file *filp, struct f2fs_gc_range *range)
34dc77ad743687 Jaegeuk Kim     2017-06-15  2484  {
ea7b72e05309d5 Chao Yu         2020-11-10  2485  	struct f2fs_sb_info *sbi = F2FS_I_SB(file_inode(filp));
34dc77ad743687 Jaegeuk Kim     2017-06-15  2486  	u64 end;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2487  	int ret;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2488  
34dc77ad743687 Jaegeuk Kim     2017-06-15  2489  	if (!capable(CAP_SYS_ADMIN))
34dc77ad743687 Jaegeuk Kim     2017-06-15  2490  		return -EPERM;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2491  	if (f2fs_readonly(sbi->sb))
34dc77ad743687 Jaegeuk Kim     2017-06-15  2492  		return -EROFS;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2493  
ea7b72e05309d5 Chao Yu         2020-11-10  2494  	end = range->start + range->len;
ea7b72e05309d5 Chao Yu         2020-11-10  2495  	if (end < range->start || range->start < MAIN_BLKADDR(sbi) ||
fbbf779989d2ef Sahitya Tummala 2019-09-17  2496  					end >= MAX_BLKADDR(sbi))
b82f6e347bfb68 Yunlei He       2018-04-24  2497  		return -EINVAL;
b82f6e347bfb68 Yunlei He       2018-04-24  2498  
34dc77ad743687 Jaegeuk Kim     2017-06-15  2499  	ret = mnt_want_write_file(filp);
34dc77ad743687 Jaegeuk Kim     2017-06-15  2500  	if (ret)
34dc77ad743687 Jaegeuk Kim     2017-06-15  2501  		return ret;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2502  
34dc77ad743687 Jaegeuk Kim     2017-06-15  2503  do_more:
ea7b72e05309d5 Chao Yu         2020-11-10  2504  	if (!range->sync) {
fb24fea75ca5ce Chao Yu         2020-01-14  2505  		if (!down_write_trylock(&sbi->gc_lock)) {
34dc77ad743687 Jaegeuk Kim     2017-06-15  2506  			ret = -EBUSY;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2507  			goto out;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2508  		}
34dc77ad743687 Jaegeuk Kim     2017-06-15  2509  	} else {
fb24fea75ca5ce Chao Yu         2020-01-14  2510  		down_write(&sbi->gc_lock);
34dc77ad743687 Jaegeuk Kim     2017-06-15  2511  	}
34dc77ad743687 Jaegeuk Kim     2017-06-15  2512  
ea7b72e05309d5 Chao Yu         2020-11-10  2513  	ret = f2fs_gc(sbi, range->sync, true, GET_SEGNO(sbi, range->start));
97767500781fae Qilong Zhang    2020-06-28  2514  	if (ret) {
97767500781fae Qilong Zhang    2020-06-28  2515  		if (ret == -EBUSY)
97767500781fae Qilong Zhang    2020-06-28  2516  			ret = -EAGAIN;
97767500781fae Qilong Zhang    2020-06-28  2517  		goto out;
97767500781fae Qilong Zhang    2020-06-28  2518  	}
ea7b72e05309d5 Chao Yu         2020-11-10  2519  	range->start += BLKS_PER_SEC(sbi);
ea7b72e05309d5 Chao Yu         2020-11-10  2520  	if (range->start <= end)
34dc77ad743687 Jaegeuk Kim     2017-06-15  2521  		goto do_more;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2522  out:
34dc77ad743687 Jaegeuk Kim     2017-06-15  2523  	mnt_drop_write_file(filp);
34dc77ad743687 Jaegeuk Kim     2017-06-15 @2524  	return ret;
34dc77ad743687 Jaegeuk Kim     2017-06-15  2525  }
34dc77ad743687 Jaegeuk Kim     2017-06-15  2526  

:::::: The code@line 2524 was first introduced by commit
:::::: 34dc77ad74368707f0f51f42536e38e6ef30ff22 f2fs: add ioctl to do gc with target block address

:::::: TO: Jaegeuk Kim <jaegeuk@kernel.org>
:::::: CC: Jaegeuk Kim <jaegeuk@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35905 bytes --]

                 reply	other threads:[~2020-11-14 11:25 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=202011141922.DzfAzSYO-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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 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.