From: kernel test robot <lkp@intel.com>
To: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: oe-kbuild-all@lists.linux.dev, Mike Snitzer <snitzer@kernel.org>
Subject: [snitzer:nfs-localio-for-6.11 13/29] fs/nfs/flexfilelayout/flexfilelayout.c:199:24: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Fri, 7 Jun 2024 16:21:38 +0800 [thread overview]
Message-ID: <202406071836.IOK5vz73-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/snitzer/linux.git nfs-localio-for-6.11
head: 1dadc081b646bfa3fca1c0e117e0be8f4de62509
commit: 51267937be8090c58d3741df1005db6b633bfc1e [13/29] pnfs/flexfiles: Enable localio for flexfiles I/O
config: arc-randconfig-r133-20240607 (https://download.01.org/0day-ci/archive/20240607/202406071836.IOK5vz73-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240607/202406071836.IOK5vz73-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/202406071836.IOK5vz73-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> fs/nfs/flexfilelayout/flexfilelayout.c:199:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct file [noderef] __rcu *_n_ @@ got struct file *[assigned] new @@
fs/nfs/flexfilelayout/flexfilelayout.c:199:24: sparse: expected struct file [noderef] __rcu *_n_
fs/nfs/flexfilelayout/flexfilelayout.c:199:24: sparse: got struct file *[assigned] new
>> fs/nfs/flexfilelayout/flexfilelayout.c:199:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *[assigned] filp @@ got struct file [noderef] __rcu *[assigned] _prev_ @@
fs/nfs/flexfilelayout/flexfilelayout.c:199:22: sparse: expected struct file *[assigned] filp
fs/nfs/flexfilelayout/flexfilelayout.c:199:22: sparse: got struct file [noderef] __rcu *[assigned] _prev_
>> fs/nfs/flexfilelayout/flexfilelayout.c:205:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct file [noderef] __rcu **f @@ got struct file ** @@
fs/nfs/flexfilelayout/flexfilelayout.c:205:30: sparse: expected struct file [noderef] __rcu **f
fs/nfs/flexfilelayout/flexfilelayout.c:205:30: sparse: got struct file **
fs/nfs/flexfilelayout/flexfilelayout.c:336:38: sparse: sparse: self-comparison always evaluates to false
fs/nfs/flexfilelayout/flexfilelayout.c:339:62: sparse: sparse: self-comparison always evaluates to false
vim +199 fs/nfs/flexfilelayout/flexfilelayout.c
165
166 static struct file *
167 ff_local_open_fh(struct pnfs_layout_segment *lseg,
168 u32 ds_idx,
169 struct nfs_client *clp,
170 const struct cred *cred,
171 struct nfs_fh *fh,
172 fmode_t mode)
173 {
174 struct nfs4_ff_layout_mirror *mirror = FF_LAYOUT_COMP(lseg, ds_idx);
175 struct file *filp, *new, __rcu **pfile;
176
177 if (!nfs_server_is_local(clp))
178 return NULL;
179 if (mode & FMODE_WRITE) {
180 /*
181 * Always request read and write access since this corresponds
182 * to a rw layout.
183 */
184 mode |= FMODE_READ;
185 pfile = &mirror->rw_file;
186 } else
187 pfile = &mirror->ro_file;
188
189 new = NULL;
190 rcu_read_lock();
191 filp = rcu_dereference(*pfile);
192 if (!filp) {
193 rcu_read_unlock();
194 new = nfs_local_open_fh(clp, cred, fh, mode);
195 if (IS_ERR(new))
196 return NULL;
197 rcu_read_lock();
198 /* try to swap in the pointer */
> 199 filp = cmpxchg(pfile, NULL, new);
200 if (!filp) {
201 filp = new;
202 new = NULL;
203 }
204 }
> 205 filp = get_file_rcu(&filp);
206 rcu_read_unlock();
207 if (new)
208 fput(new);
209 return filp;
210 }
211
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-06-07 8:22 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=202406071836.IOK5vz73-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=snitzer@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 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.