[dhowells-fs:netfs-folio-regions 12/28] fs/ceph/addr.c:311:35: warning: initialized field overwritten

From: kernel test robot
Date: Thu Aug 19 2021 - 11:35:38 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-folio-regions
head: 215a4ee495a95cc73256ed76f91cb78bcabd6b8e
commit: 9a65a2d5943a07874ad5431d9bf677b5bdc7b682 [12/28] netfs: Add a netfs inode context
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 11.2.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/commit/?id=9a65a2d5943a07874ad5431d9bf677b5bdc7b682
git remote add dhowells-fs https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git
git fetch --no-tags dhowells-fs netfs-folio-regions
git checkout 9a65a2d5943a07874ad5431d9bf677b5bdc7b682
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=xtensa

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

fs/ceph/addr.c:310:10: error: 'const struct netfs_request_ops' has no member named 'is_cache_enabled'
310 | .is_cache_enabled = ceph_is_cache_enabled,
| ^~~~~~~~~~~~~~~~
fs/ceph/addr.c:310:35: error: initialization of 'int (*)(struct netfs_read_request *)' from incompatible pointer type 'bool (*)(struct inode *)' {aka '_Bool (*)(struct inode *)'} [-Werror=incompatible-pointer-types]
310 | .is_cache_enabled = ceph_is_cache_enabled,
| ^~~~~~~~~~~~~~~~~~~~~
fs/ceph/addr.c:310:35: note: (near initialization for 'ceph_netfs_read_ops.begin_cache_operation')
>> fs/ceph/addr.c:311:35: warning: initialized field overwritten [-Woverride-init]
311 | .begin_cache_operation = ceph_begin_cache_operation,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/addr.c:311:35: note: (near initialization for 'ceph_netfs_read_ops.begin_cache_operation')
fs/ceph/addr.c: In function 'ceph_readpage':
fs/ceph/addr.c:347:37: error: passing argument 2 of 'netfs_readpage' from incompatible pointer type [-Werror=incompatible-pointer-types]
347 | return netfs_readpage(file, folio, &ceph_netfs_read_ops, NULL);
| ^~~~~
| |
| struct folio *
In file included from fs/ceph/addr.c:15:
include/linux/netfs.h:254:42: note: expected 'struct page *' but argument is of type 'struct folio *'
254 | extern int netfs_readpage(struct file *, struct page *);
| ^~~~~~~~~~~~~
fs/ceph/addr.c:347:16: error: too many arguments to function 'netfs_readpage'
347 | return netfs_readpage(file, folio, &ceph_netfs_read_ops, NULL);
| ^~~~~~~~~~~~~~
In file included from fs/ceph/addr.c:15:
include/linux/netfs.h:254:12: note: declared here
254 | extern int netfs_readpage(struct file *, struct page *);
| ^~~~~~~~~~~~~~
fs/ceph/addr.c: In function 'ceph_readahead':
fs/ceph/addr.c:378:9: error: too many arguments to function 'netfs_readahead'
378 | netfs_readahead(ractl, &ceph_netfs_read_ops, (void *)(uintptr_t)got);
| ^~~~~~~~~~~~~~~
In file included from fs/ceph/addr.c:15:
include/linux/netfs.h:253:13: note: declared here
253 | extern void netfs_readahead(struct readahead_control *);
| ^~~~~~~~~~~~~~~
fs/ceph/addr.c: In function 'ceph_write_begin':
fs/ceph/addr.c:1260:13: error: too many arguments to function 'netfs_write_begin'
1260 | r = netfs_write_begin(file, inode->i_mapping, pos, len, 0, &folio, NULL,
| ^~~~~~~~~~~~~~~~~
In file included from fs/ceph/addr.c:15:
include/linux/netfs.h:255:12: note: declared here
255 | extern int netfs_write_begin(struct file *, struct address_space *,
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +311 fs/ceph/addr.c

49870056005ca9 Jeff Layton 2020-07-09 307
9a65a2d5943a07 David Howells 2021-06-29 308 static const struct netfs_request_ops ceph_netfs_read_ops = {
f0702876e152f0 Jeff Layton 2020-06-01 309 .init_rreq = ceph_init_rreq,
f0702876e152f0 Jeff Layton 2020-06-01 310 .is_cache_enabled = ceph_is_cache_enabled,
f0702876e152f0 Jeff Layton 2020-06-01 @311 .begin_cache_operation = ceph_begin_cache_operation,
f0702876e152f0 Jeff Layton 2020-06-01 312 .issue_op = ceph_netfs_issue_op,
f0702876e152f0 Jeff Layton 2020-06-01 313 .expand_readahead = ceph_netfs_expand_readahead,
f0702876e152f0 Jeff Layton 2020-06-01 314 .clamp_length = ceph_netfs_clamp_length,
d801327d9500c7 Jeff Layton 2020-06-05 315 .check_write_begin = ceph_netfs_check_write_begin,
49870056005ca9 Jeff Layton 2020-07-09 316 .cleanup = ceph_readahead_cleanup,
f0702876e152f0 Jeff Layton 2020-06-01 317 };
f0702876e152f0 Jeff Layton 2020-06-01 318

:::::: The code at line 311 was first introduced by commit
:::::: f0702876e152f0443911514aec8b2bf563a2432b ceph: convert ceph_readpage to netfs_readpage

:::::: TO: Jeff Layton <jlayton@xxxxxxxxxx>
:::::: CC: Ilya Dryomov <idryomov@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip