CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Trond Myklebust <[email protected]>

tree:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git testing
head:   fcfa8460f356ba4174b43afdfa8ef83fcc2a2839
commit: 69e9fca6b8e59745438856462e8f1b9255d5198f [48/49] NFS: Optimise away the 
previous cookie field
:::::: branch date: 6 hours ago
:::::: commit date: 7 hours ago
config: x86_64-randconfig-m001 
(https://download.01.org/0day-ci/archive/20220228/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
fs/nfs/dir.c:319 nfs_readdir_page_array_append() warn: potential spectre issue 
'array->array' [r]

vim +319 fs/nfs/dir.c

d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  298  
69e9fca6b8e597 Trond Myklebust 2022-02-27  299  static int 
nfs_readdir_page_array_append(struct page *page,
69e9fca6b8e597 Trond Myklebust 2022-02-27  300                                  
         const struct nfs_entry *entry,
69e9fca6b8e597 Trond Myklebust 2022-02-27  301                                  
         u64 *cookie)
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  302  {
a52a8a6adad99e Trond Myklebust 2020-11-01  303          struct nfs_cache_array 
*array;
4a201d6e3f4253 Trond Myklebust 2010-10-23  304          struct 
nfs_cache_array_entry *cache_entry;
a52a8a6adad99e Trond Myklebust 2020-11-01  305          const char *name;
69e9fca6b8e597 Trond Myklebust 2022-02-27  306          int ret = -ENOMEM;
4a201d6e3f4253 Trond Myklebust 2010-10-23  307  
a52a8a6adad99e Trond Myklebust 2020-11-01  308          name = 
nfs_readdir_copy_name(entry->name, entry->len);
3020093f578fb6 Trond Myklebust 2010-11-20  309  
a52a8a6adad99e Trond Myklebust 2020-11-01  310          array = 
kmap_atomic(page);
69e9fca6b8e597 Trond Myklebust 2022-02-27  311          if (!name)
69e9fca6b8e597 Trond Myklebust 2022-02-27  312                  goto out;
b1e21c97437f64 Trond Myklebust 2020-11-01  313          ret = 
nfs_readdir_array_can_expand(array);
a52a8a6adad99e Trond Myklebust 2020-11-01  314          if (ret) {
a52a8a6adad99e Trond Myklebust 2020-11-01  315                  kfree(name);
4a201d6e3f4253 Trond Myklebust 2010-10-23  316                  goto out;
a52a8a6adad99e Trond Myklebust 2020-11-01  317          }
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  318  
b1e21c97437f64 Trond Myklebust 2020-11-01 @319          cache_entry = 
&array->array[array->size];
69e9fca6b8e597 Trond Myklebust 2022-02-27  320          cache_entry->cookie = 
array->last_cookie;
4a201d6e3f4253 Trond Myklebust 2010-10-23  321          cache_entry->ino = 
entry->ino;
0b26a0bf6ff398 Trond Myklebust 2010-11-20  322          cache_entry->d_type = 
entry->d_type;
a52a8a6adad99e Trond Myklebust 2020-11-01  323          cache_entry->name_len = 
entry->len;
a52a8a6adad99e Trond Myklebust 2020-11-01  324          cache_entry->name = 
name;
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  325          array->last_cookie = 
entry->cookie;
762567b7c798af Trond Myklebust 2020-11-04  326          if (array->last_cookie 
<= cache_entry->cookie)
762567b7c798af Trond Myklebust 2020-11-04  327                  
array->cookies_are_ordered = 0;
8cd51a0ccd1bed Trond Myklebust 2010-11-15  328          array->size++;
47c716cbf638a1 Trond Myklebust 2010-12-07  329          if (entry->eof != 0)
b1e21c97437f64 Trond Myklebust 2020-11-01  330                  
nfs_readdir_array_set_eof(array);
4a201d6e3f4253 Trond Myklebust 2010-10-23  331  out:
69e9fca6b8e597 Trond Myklebust 2022-02-27  332          *cookie = 
array->last_cookie;
a52a8a6adad99e Trond Myklebust 2020-11-01  333          kunmap_atomic(array);
4a201d6e3f4253 Trond Myklebust 2010-10-23  334          return ret;
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  335  }
d1bacf9eb2fd0e Bryan Schumaker 2010-09-24  336  

:::::: The code at line 319 was first introduced by commit
:::::: b1e21c97437f64d0a00f8fea1f9e64e77e0e4242 NFS: Clean up readdir struct 
nfs_cache_array

:::::: TO: Trond Myklebust <[email protected]>
:::::: CC: Trond Myklebust <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to