From: kbuild test robot <lkp@intel.com>
To: madhuparnabhowmik04@gmail.com
Cc: kbuild-all@lists.01.org, trond.myklebust@hammerspace.com,
anna.schumaker@netapp.com, paulmck@kernel.org,
joel@joelfernandes.org, linux-nfs@vger.kernel.org,
linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
Subject: Re: [PATCH] fs: nfs: dir.c: Fix sparse error
Date: Wed, 11 Dec 2019 09:01:52 +0800 [thread overview]
Message-ID: <201912110621.WJ6oENgf%lkp@intel.com> (raw)
In-Reply-To: <20191210054639.30003-1-madhuparnabhowmik04@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 14616 bytes --]
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on nfs/linux-next]
[cannot apply to v5.5-rc1 next-20191210]
[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/madhuparnabhowmik04-gmail-com/fs-nfs-dir-c-Fix-sparse-error/20191210-173307
base: git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: s390-debug_defconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 7.5.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
GCC_VERSION=7.5.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/rbtree.h:22:0,
from include/linux/mm_types.h:10,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:13,
from fs/nfs/dir.c:21:
fs/nfs/dir.c: In function 'nfs_access_get_cached_rcu':
>> fs/nfs/dir.c:2353:23: error: implicit declaration of function 'list_tail_rcu'; did you mean 'list_del_rcu'? [-Werror=implicit-function-declaration]
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^
include/linux/rcupdate.h:319:10: note: in definition of macro '__rcu_dereference_check'
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
>> fs/nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:319:9: error: invalid type argument of unary '*' (have 'int')
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
>> fs/nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
include/linux/rcupdate.h:319:35: error: invalid type argument of unary '*' (have 'int')
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
>> fs/nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from include/linux/list.h:9,
from include/linux/module.h:9,
from fs/nfs/dir.c:21:
include/linux/compiler.h:263:20: error: lvalue required as unary '&' operand
__read_once_size(&(x), __u.__c, sizeof(x)); \
^
include/linux/compiler.h:269:22: note: in expansion of macro '__READ_ONCE'
#define READ_ONCE(x) __READ_ONCE(x, 1)
^~~~~~~~~~~
>> include/linux/rcupdate.h:319:48: note: in expansion of macro 'READ_ONCE'
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^~~~~~~~~
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
>> fs/nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
include/linux/compiler.h:265:28: error: lvalue required as unary '&' operand
__read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
^
include/linux/compiler.h:269:22: note: in expansion of macro '__READ_ONCE'
#define READ_ONCE(x) __READ_ONCE(x, 1)
^~~~~~~~~~~
>> include/linux/rcupdate.h:319:48: note: in expansion of macro 'READ_ONCE'
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^~~~~~~~~
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
>> fs/nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
In file included from include/linux/rbtree.h:22:0,
from include/linux/mm_types.h:10,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:13,
from fs/nfs/dir.c:21:
include/linux/rcupdate.h:322:11: error: invalid type argument of unary '*' (have 'int')
((typeof(*p) __force __kernel *)(________p1)); \
^
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/rbtree.h:22:0,
from include/linux/mm_types.h:10,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:13,
from fs//nfs/dir.c:21:
fs//nfs/dir.c: In function 'nfs_access_get_cached_rcu':
fs//nfs/dir.c:2353:23: error: implicit declaration of function 'list_tail_rcu'; did you mean 'list_del_rcu'? [-Werror=implicit-function-declaration]
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^
include/linux/rcupdate.h:319:10: note: in definition of macro '__rcu_dereference_check'
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
fs//nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:319:9: error: invalid type argument of unary '*' (have 'int')
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
fs//nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
include/linux/rcupdate.h:319:35: error: invalid type argument of unary '*' (have 'int')
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
fs//nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from include/linux/list.h:9,
from include/linux/module.h:9,
from fs//nfs/dir.c:21:
include/linux/compiler.h:263:20: error: lvalue required as unary '&' operand
__read_once_size(&(x), __u.__c, sizeof(x)); \
^
include/linux/compiler.h:269:22: note: in expansion of macro '__READ_ONCE'
#define READ_ONCE(x) __READ_ONCE(x, 1)
^~~~~~~~~~~
>> include/linux/rcupdate.h:319:48: note: in expansion of macro 'READ_ONCE'
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^~~~~~~~~
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
fs//nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
include/linux/compiler.h:265:28: error: lvalue required as unary '&' operand
__read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
^
include/linux/compiler.h:269:22: note: in expansion of macro '__READ_ONCE'
#define READ_ONCE(x) __READ_ONCE(x, 1)
^~~~~~~~~~~
>> include/linux/rcupdate.h:319:48: note: in expansion of macro 'READ_ONCE'
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^~~~~~~~~
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
fs//nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
In file included from include/linux/rbtree.h:22:0,
from include/linux/mm_types.h:10,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:13,
from fs//nfs/dir.c:21:
include/linux/rcupdate.h:322:11: error: invalid type argument of unary '*' (have 'int')
((typeof(*p) __force __kernel *)(________p1)); \
^
>> include/linux/rcupdate.h:456:2: note: in expansion of macro '__rcu_dereference_check'
__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)
^~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/rcupdate.h:514:28: note: in expansion of macro 'rcu_dereference_check'
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
fs//nfs/dir.c:2353:7: note: in expansion of macro 'rcu_dereference'
lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +2353 fs/nfs/dir.c
2339
2340 static int nfs_access_get_cached_rcu(struct inode *inode, const struct cred *cred, struct nfs_access_entry *res)
2341 {
2342 /* Only check the most recently returned cache entry,
2343 * but do it without locking.
2344 */
2345 struct nfs_inode *nfsi = NFS_I(inode);
2346 struct nfs_access_entry *cache;
2347 int err = -ECHILD;
2348 struct list_head *lh;
2349
2350 rcu_read_lock();
2351 if (nfsi->cache_validity & NFS_INO_INVALID_ACCESS)
2352 goto out;
> 2353 lh = rcu_dereference(list_tail_rcu(&nfsi->access_cache_entry_lru));
2354 cache = list_entry(lh, struct nfs_access_entry, lru);
2355 if (lh == &nfsi->access_cache_entry_lru ||
2356 cred != cache->cred)
2357 cache = NULL;
2358 if (cache == NULL)
2359 goto out;
2360 if (nfs_check_cache_invalid(inode, NFS_INO_INVALID_ACCESS))
2361 goto out;
2362 res->cred = cache->cred;
2363 res->mask = cache->mask;
2364 err = 0;
2365 out:
2366 rcu_read_unlock();
2367 return err;
2368 }
2369
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 18947 bytes --]
next prev parent reply other threads:[~2019-12-11 1:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 5:46 [PATCH] fs: nfs: dir.c: Fix sparse error madhuparnabhowmik04
2019-12-11 1:01 ` kbuild test robot [this message]
2019-12-11 7:48 ` madhuparnabhowmik04
2019-12-12 4:14 ` Paul E. McKenney
2019-12-12 13:45 ` Trond Myklebust
2019-12-12 18:03 ` Paul E. McKenney
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=201912110621.WJ6oENgf%lkp@intel.com \
--to=lkp@intel.com \
--cc=anna.schumaker@netapp.com \
--cc=joel@joelfernandes.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=madhuparnabhowmik04@gmail.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=trond.myklebust@hammerspace.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).