* [trondmy-nfs-2.6:testing 52/72] fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared
@ 2022-03-18 6:49 kernel test robot
2022-03-18 9:52 ` David Wysochanski
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-03-18 6:49 UTC (permalink / raw)
To: Dave Wysochanski; +Cc: kbuild-all, linux-kernel, Trond Myklebust
tree: git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git testing
head: 2fd93b6b58106aa3bc5a70739ba0f86cfee8fda9
commit: 45f3a70ba68e1fc7fe0edde731b08d85435da30d [52/72] NFS: Cleanup usage of nfs_inode in fscache interface
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20220318/202203181425.lKRZyrao-lkp@intel.com/config)
compiler: arm-linux-gnueabi-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
git remote add trondmy-nfs-2.6 git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git
git fetch --no-tags trondmy-nfs-2.6 testing
git checkout 45f3a70ba68e1fc7fe0edde731b08d85435da30d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash fs/nfs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Note: the trondmy-nfs-2.6/testing HEAD 2fd93b6b58106aa3bc5a70739ba0f86cfee8fda9 builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:29,
from fs/nfs/fscache.c:9:
fs/nfs/fscache.c: In function 'nfs_fscache_open_file':
>> fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared (first use in this function)
231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
| ^~~~
include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
418 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/sunrpc/debug.h:40:17: note: in expansion of macro 'printk'
40 | printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
| ^~~~~~
fs/nfs/fscache.c:231:17: note: in expansion of macro 'dfprintk'
231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
| ^~~~~~~~
fs/nfs/fscache.c:231:71: note: each undeclared identifier is reported only once for each function it appears in
231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
| ^~~~
include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
418 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
include/linux/sunrpc/debug.h:40:17: note: in expansion of macro 'printk'
40 | printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
| ^~~~~~
fs/nfs/fscache.c:231:17: note: in expansion of macro 'dfprintk'
231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
| ^~~~~~~~
vim +/nfsi +231 fs/nfs/fscache.c
ef79c097bbe9724 David Howells 2009-04-03 200
ef79c097bbe9724 David Howells 2009-04-03 201 /*
f1fe29b4a02d080 David Howells 2013-09-27 202 * Enable or disable caching for a file that is being opened as appropriate.
f1fe29b4a02d080 David Howells 2013-09-27 203 * The cookie is allocated when the inode is initialised, but is not enabled at
f1fe29b4a02d080 David Howells 2013-09-27 204 * that time. Enablement is deferred to file-open time to avoid stat() and
f1fe29b4a02d080 David Howells 2013-09-27 205 * access() thrashing the cache.
f1fe29b4a02d080 David Howells 2013-09-27 206 *
f1fe29b4a02d080 David Howells 2013-09-27 207 * For now, with NFS, only regular files that are open read-only will be able
ef79c097bbe9724 David Howells 2009-04-03 208 * to use the cache.
f1fe29b4a02d080 David Howells 2013-09-27 209 *
f1fe29b4a02d080 David Howells 2013-09-27 210 * We enable the cache for an inode if we open it read-only and it isn't
f1fe29b4a02d080 David Howells 2013-09-27 211 * currently open for writing. We disable the cache if the inode is open
f1fe29b4a02d080 David Howells 2013-09-27 212 * write-only.
f1fe29b4a02d080 David Howells 2013-09-27 213 *
f1fe29b4a02d080 David Howells 2013-09-27 214 * The caller uses the file struct to pin i_writecount on the inode before
f1fe29b4a02d080 David Howells 2013-09-27 215 * calling us when a file is opened for writing, so we can make use of that.
f1fe29b4a02d080 David Howells 2013-09-27 216 *
f1fe29b4a02d080 David Howells 2013-09-27 217 * Note that this may be invoked multiple times in parallel by parallel
f1fe29b4a02d080 David Howells 2013-09-27 218 * nfs_open() functions.
ef79c097bbe9724 David Howells 2009-04-03 219 */
f1fe29b4a02d080 David Howells 2013-09-27 220 void nfs_fscache_open_file(struct inode *inode, struct file *filp)
ef79c097bbe9724 David Howells 2009-04-03 221 {
402cb8dda949d9b David Howells 2018-04-04 222 struct nfs_fscache_inode_auxdata auxdata;
f1fe29b4a02d080 David Howells 2013-09-27 223 struct fscache_cookie *cookie = nfs_i_fscache(inode);
a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 224 bool open_for_write = inode_is_open_for_write(inode);
ef79c097bbe9724 David Howells 2009-04-03 225
f1fe29b4a02d080 David Howells 2013-09-27 226 if (!fscache_cookie_valid(cookie))
f1fe29b4a02d080 David Howells 2013-09-27 227 return;
ef79c097bbe9724 David Howells 2009-04-03 228
a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 229 fscache_use_cookie(cookie, open_for_write);
a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 230 if (open_for_write) {
f1fe29b4a02d080 David Howells 2013-09-27 @231 dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
45f3a70ba68e1fc Dave Wysochanski 2022-03-01 232 nfs_fscache_update_auxdata(&auxdata, inode);
a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 233 fscache_invalidate(cookie, &auxdata, i_size_read(inode),
a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 234 FSCACHE_INVAL_DIO_WRITE);
ef79c097bbe9724 David Howells 2009-04-03 235 }
ef79c097bbe9724 David Howells 2009-04-03 236 }
f1fe29b4a02d080 David Howells 2013-09-27 237 EXPORT_SYMBOL_GPL(nfs_fscache_open_file);
545db45f0fc0d42 David Howells 2009-04-03 238
:::::: The code at line 231 was first introduced by commit
:::::: f1fe29b4a02d0805aa7d0ff6b73410a9f9316d69 NFS: Use i_writecount to control whether to get an fscache cookie in nfs_open()
:::::: TO: David Howells <dhowells@redhat.com>
:::::: CC: David Howells <dhowells@redhat.com>
---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [trondmy-nfs-2.6:testing 52/72] fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared
2022-03-18 6:49 [trondmy-nfs-2.6:testing 52/72] fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared kernel test robot
@ 2022-03-18 9:52 ` David Wysochanski
0 siblings, 0 replies; 3+ messages in thread
From: David Wysochanski @ 2022-03-18 9:52 UTC (permalink / raw)
To: kernel test robot; +Cc: kbuild-all, Linux Kernel Mailing List, Trond Myklebust
On Fri, Mar 18, 2022 at 2:51 AM kernel test robot <lkp@intel.com> wrote:
>
> tree: git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git testing
> head: 2fd93b6b58106aa3bc5a70739ba0f86cfee8fda9
> commit: 45f3a70ba68e1fc7fe0edde731b08d85435da30d [52/72] NFS: Cleanup usage of nfs_inode in fscache interface
> config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20220318/202203181425.lKRZyrao-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-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
> git remote add trondmy-nfs-2.6 git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git
> git fetch --no-tags trondmy-nfs-2.6 testing
> git checkout 45f3a70ba68e1fc7fe0edde731b08d85435da30d
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash fs/nfs/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> Note: the trondmy-nfs-2.6/testing HEAD 2fd93b6b58106aa3bc5a70739ba0f86cfee8fda9 builds fine.
> It only hurts bisectability.
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/kernel.h:29,
> from fs/nfs/fscache.c:9:
> fs/nfs/fscache.c: In function 'nfs_fscache_open_file':
> >> fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared (first use in this function)
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~
> include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
> 418 | _p_func(_fmt, ##__VA_ARGS__); \
> | ^~~~~~~~~~~
> include/linux/sunrpc/debug.h:40:17: note: in expansion of macro 'printk'
> 40 | printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
> | ^~~~~~
> fs/nfs/fscache.c:231:17: note: in expansion of macro 'dfprintk'
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~~~~~
> fs/nfs/fscache.c:231:71: note: each undeclared identifier is reported only once for each function it appears in
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~
> include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
> 418 | _p_func(_fmt, ##__VA_ARGS__); \
> | ^~~~~~~~~~~
> include/linux/sunrpc/debug.h:40:17: note: in expansion of macro 'printk'
> 40 | printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
> | ^~~~~~
> fs/nfs/fscache.c:231:17: note: in expansion of macro 'dfprintk'
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~~~~~
>
>
> vim +/nfsi +231 fs/nfs/fscache.c
>
> ef79c097bbe9724 David Howells 2009-04-03 200
> ef79c097bbe9724 David Howells 2009-04-03 201 /*
> f1fe29b4a02d080 David Howells 2013-09-27 202 * Enable or disable caching for a file that is being opened as appropriate.
> f1fe29b4a02d080 David Howells 2013-09-27 203 * The cookie is allocated when the inode is initialised, but is not enabled at
> f1fe29b4a02d080 David Howells 2013-09-27 204 * that time. Enablement is deferred to file-open time to avoid stat() and
> f1fe29b4a02d080 David Howells 2013-09-27 205 * access() thrashing the cache.
> f1fe29b4a02d080 David Howells 2013-09-27 206 *
> f1fe29b4a02d080 David Howells 2013-09-27 207 * For now, with NFS, only regular files that are open read-only will be able
> ef79c097bbe9724 David Howells 2009-04-03 208 * to use the cache.
> f1fe29b4a02d080 David Howells 2013-09-27 209 *
> f1fe29b4a02d080 David Howells 2013-09-27 210 * We enable the cache for an inode if we open it read-only and it isn't
> f1fe29b4a02d080 David Howells 2013-09-27 211 * currently open for writing. We disable the cache if the inode is open
> f1fe29b4a02d080 David Howells 2013-09-27 212 * write-only.
> f1fe29b4a02d080 David Howells 2013-09-27 213 *
> f1fe29b4a02d080 David Howells 2013-09-27 214 * The caller uses the file struct to pin i_writecount on the inode before
> f1fe29b4a02d080 David Howells 2013-09-27 215 * calling us when a file is opened for writing, so we can make use of that.
> f1fe29b4a02d080 David Howells 2013-09-27 216 *
> f1fe29b4a02d080 David Howells 2013-09-27 217 * Note that this may be invoked multiple times in parallel by parallel
> f1fe29b4a02d080 David Howells 2013-09-27 218 * nfs_open() functions.
> ef79c097bbe9724 David Howells 2009-04-03 219 */
> f1fe29b4a02d080 David Howells 2013-09-27 220 void nfs_fscache_open_file(struct inode *inode, struct file *filp)
> ef79c097bbe9724 David Howells 2009-04-03 221 {
> 402cb8dda949d9b David Howells 2018-04-04 222 struct nfs_fscache_inode_auxdata auxdata;
> f1fe29b4a02d080 David Howells 2013-09-27 223 struct fscache_cookie *cookie = nfs_i_fscache(inode);
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 224 bool open_for_write = inode_is_open_for_write(inode);
> ef79c097bbe9724 David Howells 2009-04-03 225
> f1fe29b4a02d080 David Howells 2013-09-27 226 if (!fscache_cookie_valid(cookie))
> f1fe29b4a02d080 David Howells 2013-09-27 227 return;
> ef79c097bbe9724 David Howells 2009-04-03 228
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 229 fscache_use_cookie(cookie, open_for_write);
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 230 if (open_for_write) {
> f1fe29b4a02d080 David Howells 2013-09-27 @231 dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> 45f3a70ba68e1fc Dave Wysochanski 2022-03-01 232 nfs_fscache_update_auxdata(&auxdata, inode);
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 233 fscache_invalidate(cookie, &auxdata, i_size_read(inode),
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 234 FSCACHE_INVAL_DIO_WRITE);
> ef79c097bbe9724 David Howells 2009-04-03 235 }
> ef79c097bbe9724 David Howells 2009-04-03 236 }
> f1fe29b4a02d080 David Howells 2013-09-27 237 EXPORT_SYMBOL_GPL(nfs_fscache_open_file);
> 545db45f0fc0d42 David Howells 2009-04-03 238
>
> :::::: The code at line 231 was first introduced by commit
> :::::: f1fe29b4a02d0805aa7d0ff6b73410a9f9316d69 NFS: Use i_writecount to control whether to get an fscache cookie in nfs_open()
>
> :::::: TO: David Howells <dhowells@redhat.com>
> :::::: CC: David Howells <dhowells@redhat.com>
>
> ---
> 0-DAY CI Kernel Test Service
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
Apologies for the oversight.
Fixing this requires adding a 1 liner to the patch in question, then
removing it after a few patches.
Add the below 1-liner on top commit:
45f3a70ba68e1fc7fe0edde731b08d85435da30d [52/72] NFS: Cleanup usage of
nfs_inode in fscache interface
commit bfec475e971304a737acd1fd9e4cbbb37f0f7eff (HEAD -> trond-testing)
Author: Dave Wysochanski <dwysocha@redhat.com>
Date: Fri Mar 18 05:36:11 2022 -0400
NFS: Fix bisectability of 'Cleanup usage of nfs_inode in fscache interface'
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index 81bd2770e640..2e77f0d9ebf4 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -220,6 +220,7 @@ void nfs_fscache_clear_inode(struct inode *inode)
void nfs_fscache_open_file(struct inode *inode, struct file *filp)
{
struct nfs_fscache_inode_auxdata auxdata;
+ struct nfs_inode *nfsi = NFS_I(inode);
struct fscache_cookie *cookie = nfs_i_fscache(inode);
bool open_for_write = inode_is_open_for_write(inode);
Then remove the line in the 4th patch in my series to avoid a warning
on an unused variable:
commit bb1dd0ecedba4a75889894ecce560558720c39f5 (HEAD -> trond-testing)
Author: Dave Wysochanski <dwysocha@redhat.com>
Date: Fri Mar 18 05:48:29 2022 -0400
NFS: Fix build error on 'Remove remaining dfprintks related to fscache'
Fixes the following build error:
fs/nfs/fscache.c: In function ‘nfs_fscache_open_file’:
fs/nfs/fscache.c:215:27: warning: unused variable ‘nfsi’ [-Wunused-variable]
215 | struct nfs_inode *nfsi = NFS_I(inode);
| ^~~~
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index e427f3343f0f..4dee53ceb941 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -212,7 +212,6 @@ void nfs_fscache_clear_inode(struct inode *inode)
void nfs_fscache_open_file(struct inode *inode, struct file *filp)
{
struct nfs_fscache_inode_auxdata auxdata;
- struct nfs_inode *nfsi = NFS_I(inode);
struct fscache_cookie *cookie = nfs_i_fscache(inode);
bool open_for_write = inode_is_open_for_write(inode);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [trondmy-nfs-2.6:testing 52/72] fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared
@ 2022-03-18 9:52 ` David Wysochanski
0 siblings, 0 replies; 3+ messages in thread
From: David Wysochanski @ 2022-03-18 9:52 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 9747 bytes --]
On Fri, Mar 18, 2022 at 2:51 AM kernel test robot <lkp@intel.com> wrote:
>
> tree: git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git testing
> head: 2fd93b6b58106aa3bc5a70739ba0f86cfee8fda9
> commit: 45f3a70ba68e1fc7fe0edde731b08d85435da30d [52/72] NFS: Cleanup usage of nfs_inode in fscache interface
> config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20220318/202203181425.lKRZyrao-lkp(a)intel.com/config)
> compiler: arm-linux-gnueabi-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
> git remote add trondmy-nfs-2.6 git://git.linux-nfs.org/projects/trondmy/nfs-2.6.git
> git fetch --no-tags trondmy-nfs-2.6 testing
> git checkout 45f3a70ba68e1fc7fe0edde731b08d85435da30d
> # save the config file to linux build tree
> mkdir build_dir
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash fs/nfs/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> Note: the trondmy-nfs-2.6/testing HEAD 2fd93b6b58106aa3bc5a70739ba0f86cfee8fda9 builds fine.
> It only hurts bisectability.
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/kernel.h:29,
> from fs/nfs/fscache.c:9:
> fs/nfs/fscache.c: In function 'nfs_fscache_open_file':
> >> fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared (first use in this function)
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~
> include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
> 418 | _p_func(_fmt, ##__VA_ARGS__); \
> | ^~~~~~~~~~~
> include/linux/sunrpc/debug.h:40:17: note: in expansion of macro 'printk'
> 40 | printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
> | ^~~~~~
> fs/nfs/fscache.c:231:17: note: in expansion of macro 'dfprintk'
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~~~~~
> fs/nfs/fscache.c:231:71: note: each undeclared identifier is reported only once for each function it appears in
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~
> include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap'
> 418 | _p_func(_fmt, ##__VA_ARGS__); \
> | ^~~~~~~~~~~
> include/linux/sunrpc/debug.h:40:17: note: in expansion of macro 'printk'
> 40 | printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
> | ^~~~~~
> fs/nfs/fscache.c:231:17: note: in expansion of macro 'dfprintk'
> 231 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> | ^~~~~~~~
>
>
> vim +/nfsi +231 fs/nfs/fscache.c
>
> ef79c097bbe9724 David Howells 2009-04-03 200
> ef79c097bbe9724 David Howells 2009-04-03 201 /*
> f1fe29b4a02d080 David Howells 2013-09-27 202 * Enable or disable caching for a file that is being opened as appropriate.
> f1fe29b4a02d080 David Howells 2013-09-27 203 * The cookie is allocated when the inode is initialised, but is not enabled at
> f1fe29b4a02d080 David Howells 2013-09-27 204 * that time. Enablement is deferred to file-open time to avoid stat() and
> f1fe29b4a02d080 David Howells 2013-09-27 205 * access() thrashing the cache.
> f1fe29b4a02d080 David Howells 2013-09-27 206 *
> f1fe29b4a02d080 David Howells 2013-09-27 207 * For now, with NFS, only regular files that are open read-only will be able
> ef79c097bbe9724 David Howells 2009-04-03 208 * to use the cache.
> f1fe29b4a02d080 David Howells 2013-09-27 209 *
> f1fe29b4a02d080 David Howells 2013-09-27 210 * We enable the cache for an inode if we open it read-only and it isn't
> f1fe29b4a02d080 David Howells 2013-09-27 211 * currently open for writing. We disable the cache if the inode is open
> f1fe29b4a02d080 David Howells 2013-09-27 212 * write-only.
> f1fe29b4a02d080 David Howells 2013-09-27 213 *
> f1fe29b4a02d080 David Howells 2013-09-27 214 * The caller uses the file struct to pin i_writecount on the inode before
> f1fe29b4a02d080 David Howells 2013-09-27 215 * calling us when a file is opened for writing, so we can make use of that.
> f1fe29b4a02d080 David Howells 2013-09-27 216 *
> f1fe29b4a02d080 David Howells 2013-09-27 217 * Note that this may be invoked multiple times in parallel by parallel
> f1fe29b4a02d080 David Howells 2013-09-27 218 * nfs_open() functions.
> ef79c097bbe9724 David Howells 2009-04-03 219 */
> f1fe29b4a02d080 David Howells 2013-09-27 220 void nfs_fscache_open_file(struct inode *inode, struct file *filp)
> ef79c097bbe9724 David Howells 2009-04-03 221 {
> 402cb8dda949d9b David Howells 2018-04-04 222 struct nfs_fscache_inode_auxdata auxdata;
> f1fe29b4a02d080 David Howells 2013-09-27 223 struct fscache_cookie *cookie = nfs_i_fscache(inode);
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 224 bool open_for_write = inode_is_open_for_write(inode);
> ef79c097bbe9724 David Howells 2009-04-03 225
> f1fe29b4a02d080 David Howells 2013-09-27 226 if (!fscache_cookie_valid(cookie))
> f1fe29b4a02d080 David Howells 2013-09-27 227 return;
> ef79c097bbe9724 David Howells 2009-04-03 228
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 229 fscache_use_cookie(cookie, open_for_write);
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 230 if (open_for_write) {
> f1fe29b4a02d080 David Howells 2013-09-27 @231 dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi);
> 45f3a70ba68e1fc Dave Wysochanski 2022-03-01 232 nfs_fscache_update_auxdata(&auxdata, inode);
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 233 fscache_invalidate(cookie, &auxdata, i_size_read(inode),
> a6b5a28eb56c3f4 Dave Wysochanski 2020-11-14 234 FSCACHE_INVAL_DIO_WRITE);
> ef79c097bbe9724 David Howells 2009-04-03 235 }
> ef79c097bbe9724 David Howells 2009-04-03 236 }
> f1fe29b4a02d080 David Howells 2013-09-27 237 EXPORT_SYMBOL_GPL(nfs_fscache_open_file);
> 545db45f0fc0d42 David Howells 2009-04-03 238
>
> :::::: The code at line 231 was first introduced by commit
> :::::: f1fe29b4a02d0805aa7d0ff6b73410a9f9316d69 NFS: Use i_writecount to control whether to get an fscache cookie in nfs_open()
>
> :::::: TO: David Howells <dhowells@redhat.com>
> :::::: CC: David Howells <dhowells@redhat.com>
>
> ---
> 0-DAY CI Kernel Test Service
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
>
Apologies for the oversight.
Fixing this requires adding a 1 liner to the patch in question, then
removing it after a few patches.
Add the below 1-liner on top commit:
45f3a70ba68e1fc7fe0edde731b08d85435da30d [52/72] NFS: Cleanup usage of
nfs_inode in fscache interface
commit bfec475e971304a737acd1fd9e4cbbb37f0f7eff (HEAD -> trond-testing)
Author: Dave Wysochanski <dwysocha@redhat.com>
Date: Fri Mar 18 05:36:11 2022 -0400
NFS: Fix bisectability of 'Cleanup usage of nfs_inode in fscache interface'
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index 81bd2770e640..2e77f0d9ebf4 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -220,6 +220,7 @@ void nfs_fscache_clear_inode(struct inode *inode)
void nfs_fscache_open_file(struct inode *inode, struct file *filp)
{
struct nfs_fscache_inode_auxdata auxdata;
+ struct nfs_inode *nfsi = NFS_I(inode);
struct fscache_cookie *cookie = nfs_i_fscache(inode);
bool open_for_write = inode_is_open_for_write(inode);
Then remove the line in the 4th patch in my series to avoid a warning
on an unused variable:
commit bb1dd0ecedba4a75889894ecce560558720c39f5 (HEAD -> trond-testing)
Author: Dave Wysochanski <dwysocha@redhat.com>
Date: Fri Mar 18 05:48:29 2022 -0400
NFS: Fix build error on 'Remove remaining dfprintks related to fscache'
Fixes the following build error:
fs/nfs/fscache.c: In function ‘nfs_fscache_open_file’:
fs/nfs/fscache.c:215:27: warning: unused variable ‘nfsi’ [-Wunused-variable]
215 | struct nfs_inode *nfsi = NFS_I(inode);
| ^~~~
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index e427f3343f0f..4dee53ceb941 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -212,7 +212,6 @@ void nfs_fscache_clear_inode(struct inode *inode)
void nfs_fscache_open_file(struct inode *inode, struct file *filp)
{
struct nfs_fscache_inode_auxdata auxdata;
- struct nfs_inode *nfsi = NFS_I(inode);
struct fscache_cookie *cookie = nfs_i_fscache(inode);
bool open_for_write = inode_is_open_for_write(inode);
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-03-18 9:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 6:49 [trondmy-nfs-2.6:testing 52/72] fs/nfs/fscache.c:231:71: error: 'nfsi' undeclared kernel test robot
2022-03-18 9:52 ` David Wysochanski
2022-03-18 9:52 ` David Wysochanski
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.