From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [dhowells-fs:netfs-next 35/50] fs/afs/symlink.c:97:7: warning: variable 'ret' is uninitialized when used here
Date: Sun, 03 May 2026 19:49:14 +0800 [thread overview]
Message-ID: <202605031901.PLq38ZSR-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-next
head: 2c55c7cf98847d593219ef29d3fedfd551d6f55f
commit: 25e721fd0e1f943f6dedd9c4d664bbeee8e1d21e [35/50] afs: Use a bvecq to hold dir content rather than folioq
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260503/202605031901.PLq38ZSR-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260503/202605031901.PLq38ZSR-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/202605031901.PLq38ZSR-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/afs/symlink.c:97:7: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
97 | if (ret < 0)
| ^~~
fs/afs/symlink.c:86:13: note: initialize the variable 'ret' to silence this warning
86 | ssize_t ret;
| ^
| = 0
1 warning generated.
vim +/ret +97 fs/afs/symlink.c
ec065c80239311 David Howells 2026-04-27 78
ec065c80239311 David Howells 2026-04-27 79 /*
ec065c80239311 David Howells 2026-04-27 80 * Read a symlink in a single download.
ec065c80239311 David Howells 2026-04-27 81 */
ec065c80239311 David Howells 2026-04-27 82 static ssize_t afs_do_read_symlink(struct afs_vnode *vnode)
ec065c80239311 David Howells 2026-04-27 83 {
ec065c80239311 David Howells 2026-04-27 84 struct afs_symlink *symlink;
ec065c80239311 David Howells 2026-04-27 85 struct iov_iter iter;
ec065c80239311 David Howells 2026-04-27 86 ssize_t ret;
ec065c80239311 David Howells 2026-04-27 87 loff_t i_size;
ec065c80239311 David Howells 2026-04-27 88
ec065c80239311 David Howells 2026-04-27 89 i_size = i_size_read(&vnode->netfs.inode);
ec065c80239311 David Howells 2026-04-27 90 if (i_size > PAGE_SIZE - 1) {
ec065c80239311 David Howells 2026-04-27 91 trace_afs_file_error(vnode, -EFBIG, afs_file_error_dir_big);
ec065c80239311 David Howells 2026-04-27 92 return -EFBIG;
ec065c80239311 David Howells 2026-04-27 93 }
ec065c80239311 David Howells 2026-04-27 94
ec065c80239311 David Howells 2026-04-27 95 if (!vnode->directory) {
25e721fd0e1f94 David Howells 2026-01-07 96 vnode->directory = bvecq_alloc_buffer(PAGE_SIZE, 0, GFP_KERNEL);
ec065c80239311 David Howells 2026-04-27 @97 if (ret < 0)
ec065c80239311 David Howells 2026-04-27 98 return ret;
ec065c80239311 David Howells 2026-04-27 99 }
ec065c80239311 David Howells 2026-04-27 100
25e721fd0e1f94 David Howells 2026-01-07 101 iov_iter_bvec_queue(&iter, ITER_DEST, vnode->directory, 0, 0, PAGE_SIZE);
ec065c80239311 David Howells 2026-04-27 102
ec065c80239311 David Howells 2026-04-27 103 /* AFS requires us to perform the read of a symlink as a single unit to
ec065c80239311 David Howells 2026-04-27 104 * avoid issues with the content being changed between reads.
ec065c80239311 David Howells 2026-04-27 105 */
ec065c80239311 David Howells 2026-04-27 106 ret = netfs_read_single(&vnode->netfs.inode, NULL, &iter);
ec065c80239311 David Howells 2026-04-27 107 if (ret >= 0) {
ec065c80239311 David Howells 2026-04-27 108 i_size = ret;
ec065c80239311 David Howells 2026-04-27 109 if (i_size > PAGE_SIZE - 1) {
ec065c80239311 David Howells 2026-04-27 110 trace_afs_file_error(vnode, -EFBIG, afs_file_error_dir_big);
ec065c80239311 David Howells 2026-04-27 111 return -EFBIG;
ec065c80239311 David Howells 2026-04-27 112 }
ec065c80239311 David Howells 2026-04-27 113 vnode->directory_size = i_size;
ec065c80239311 David Howells 2026-04-27 114
ec065c80239311 David Howells 2026-04-27 115 /* Copy the symlink. */
ec065c80239311 David Howells 2026-04-27 116 symlink = kmalloc_flex(struct afs_symlink, content, i_size + 1,
ec065c80239311 David Howells 2026-04-27 117 GFP_KERNEL);
ec065c80239311 David Howells 2026-04-27 118 if (!symlink)
ec065c80239311 David Howells 2026-04-27 119 return -ENOMEM;
ec065c80239311 David Howells 2026-04-27 120
ec065c80239311 David Howells 2026-04-27 121 refcount_set(&symlink->ref, 1);
ec065c80239311 David Howells 2026-04-27 122 symlink->content[i_size] = 0;
ec065c80239311 David Howells 2026-04-27 123
25e721fd0e1f94 David Howells 2026-01-07 124 const char *s = kmap_local_bvec(&vnode->directory->bv[0], 0);
ec065c80239311 David Howells 2026-04-27 125
ec065c80239311 David Howells 2026-04-27 126 memcpy(symlink->content, s, i_size);
ec065c80239311 David Howells 2026-04-27 127 kunmap_local(s);
ec065c80239311 David Howells 2026-04-27 128
ec065c80239311 David Howells 2026-04-27 129 afs_replace_symlink(vnode, symlink);
ec065c80239311 David Howells 2026-04-27 130 }
ec065c80239311 David Howells 2026-04-27 131
ec065c80239311 David Howells 2026-04-27 132 if (!fscache_cookie_enabled(netfs_i_cookie(&vnode->netfs))) {
25e721fd0e1f94 David Howells 2026-01-07 133 bvecq_put(vnode->directory);
ec065c80239311 David Howells 2026-04-27 134 vnode->directory = NULL;
ec065c80239311 David Howells 2026-04-27 135 vnode->directory_size = 0;
ec065c80239311 David Howells 2026-04-27 136 }
ec065c80239311 David Howells 2026-04-27 137
ec065c80239311 David Howells 2026-04-27 138 return ret;
ec065c80239311 David Howells 2026-04-27 139 }
ec065c80239311 David Howells 2026-04-27 140
:::::: The code at line 97 was first introduced by commit
:::::: ec065c8023931168a4e590fda4b900860b2cdcb1 afs: Fix the locking used by afs_get_link()
:::::: TO: David Howells <dhowells@redhat.com>
:::::: CC: David Howells <dhowells@redhat.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-05-03 11:49 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=202605031901.PLq38ZSR-lkp@intel.com \
--to=lkp@intel.com \
--cc=dhowells@redhat.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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.