From: kbuild test robot <lkp@intel.com>
To: wu000273@umn.edu, clm@fb.com, josef@toxicpanda.com,
dsterba@suse.com, linux-btrfs@vger.kernel.org,
linux-kernel@vger.kernel.org, kjlu@umn.edu
Cc: kbuild-all@lists.01.org, josef@toxicpanda.com, dsterba@suse.com,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
kjlu@umn.edu
Subject: Re: [PATCH] btrfs: fix a potential racy
Date: Thu, 23 Apr 2020 01:54:46 +0800 [thread overview]
Message-ID: <202004230158.sOCsljPW%lkp@intel.com> (raw)
In-Reply-To: <20200419015907.15503-1-wu000273@umn.edu>
[-- Attachment #1: Type: text/plain, Size: 5057 bytes --]
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on btrfs/next]
[also build test WARNING on v5.7-rc2 next-20200421]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/wu000273-umn-edu/btrfs-fix-a-potential-racy/20200421-072124
base: https://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git next
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/btrfs/reada.c: In function 'reada_extent_put':
>> fs/btrfs/reada.c:509:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
509 | struct reada_zone *zone = re->zones[i];
| ^~~~~~
vim +509 fs/btrfs/reada.c
7414a03fbf9e75 Arne Jansen 2011-05-23 485
7414a03fbf9e75 Arne Jansen 2011-05-23 486 static void reada_extent_put(struct btrfs_fs_info *fs_info,
7414a03fbf9e75 Arne Jansen 2011-05-23 487 struct reada_extent *re)
7414a03fbf9e75 Arne Jansen 2011-05-23 488 {
7414a03fbf9e75 Arne Jansen 2011-05-23 489 int i;
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 490 unsigned long index = re->logical >> PAGE_SHIFT;
7414a03fbf9e75 Arne Jansen 2011-05-23 491
7414a03fbf9e75 Arne Jansen 2011-05-23 492 spin_lock(&fs_info->reada_lock);
99621b44aa194e Al Viro 2012-08-29 493 if (--re->refcnt) {
7414a03fbf9e75 Arne Jansen 2011-05-23 494 spin_unlock(&fs_info->reada_lock);
7414a03fbf9e75 Arne Jansen 2011-05-23 495 return;
7414a03fbf9e75 Arne Jansen 2011-05-23 496 }
7414a03fbf9e75 Arne Jansen 2011-05-23 497
7414a03fbf9e75 Arne Jansen 2011-05-23 498 radix_tree_delete(&fs_info->reada_tree, index);
7414a03fbf9e75 Arne Jansen 2011-05-23 499 for (i = 0; i < re->nzones; ++i) {
7414a03fbf9e75 Arne Jansen 2011-05-23 500 struct reada_zone *zone = re->zones[i];
7414a03fbf9e75 Arne Jansen 2011-05-23 501
7414a03fbf9e75 Arne Jansen 2011-05-23 502 radix_tree_delete(&zone->device->reada_extents, index);
7414a03fbf9e75 Arne Jansen 2011-05-23 503 }
7414a03fbf9e75 Arne Jansen 2011-05-23 504
7414a03fbf9e75 Arne Jansen 2011-05-23 505 spin_unlock(&fs_info->reada_lock);
7414a03fbf9e75 Arne Jansen 2011-05-23 506
7414a03fbf9e75 Arne Jansen 2011-05-23 507 for (i = 0; i < re->nzones; ++i) {
1255ee642bf9b0 Qiushi Wu 2020-04-18 508 spin_lock(&fs_info->reada_lock);
7414a03fbf9e75 Arne Jansen 2011-05-23 @509 struct reada_zone *zone = re->zones[i];
7414a03fbf9e75 Arne Jansen 2011-05-23 510 kref_get(&zone->refcnt);
1255ee642bf9b0 Qiushi Wu 2020-04-18 511 spin_unlock(&fs_info->reada_lock);
1255ee642bf9b0 Qiushi Wu 2020-04-18 512
7414a03fbf9e75 Arne Jansen 2011-05-23 513 spin_lock(&zone->lock);
7414a03fbf9e75 Arne Jansen 2011-05-23 514 --zone->elems;
7414a03fbf9e75 Arne Jansen 2011-05-23 515 if (zone->elems == 0) {
7414a03fbf9e75 Arne Jansen 2011-05-23 516 /* no fs_info->reada_lock needed, as this can't be
7414a03fbf9e75 Arne Jansen 2011-05-23 517 * the last ref */
7414a03fbf9e75 Arne Jansen 2011-05-23 518 kref_put(&zone->refcnt, reada_zone_release);
7414a03fbf9e75 Arne Jansen 2011-05-23 519 }
7414a03fbf9e75 Arne Jansen 2011-05-23 520 spin_unlock(&zone->lock);
7414a03fbf9e75 Arne Jansen 2011-05-23 521
7414a03fbf9e75 Arne Jansen 2011-05-23 522 spin_lock(&fs_info->reada_lock);
7414a03fbf9e75 Arne Jansen 2011-05-23 523 kref_put(&zone->refcnt, reada_zone_release);
7414a03fbf9e75 Arne Jansen 2011-05-23 524 spin_unlock(&fs_info->reada_lock);
7414a03fbf9e75 Arne Jansen 2011-05-23 525 }
7414a03fbf9e75 Arne Jansen 2011-05-23 526
7414a03fbf9e75 Arne Jansen 2011-05-23 527 kfree(re);
7414a03fbf9e75 Arne Jansen 2011-05-23 528 }
7414a03fbf9e75 Arne Jansen 2011-05-23 529
:::::: The code at line 509 was first introduced by commit
:::::: 7414a03fbf9e75fbbf2a3c16828cd862e572aa44 btrfs: initial readahead code and prototypes
:::::: TO: Arne Jansen <sensille@gmx.net>
:::::: CC: Arne Jansen <sensille@gmx.net>
---
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: 58149 bytes --]
next prev parent reply other threads:[~2020-04-22 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 1:59 [PATCH] btrfs: fix a potential racy wu000273
2020-04-22 17:54 ` kbuild test robot [this message]
2020-04-22 21:45 ` David Sterba
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=202004230158.sOCsljPW%lkp@intel.com \
--to=lkp@intel.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=kbuild-all@lists.01.org \
--cc=kjlu@umn.edu \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wu000273@umn.edu \
/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