* [dhowells-fs:netfs-crypt 37/42] fs/netfs/direct_read.c:86:20: warning: variable 'len' is uninitialized when used here
@ 2026-03-23 20:57 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-03-23 20:57 UTC (permalink / raw)
To: David Howells; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-crypt
head: ae7ccdf83025020c44837849de26fb4546fbf825
commit: e7c8280c95acfbbef1fc569cbb950835ab68c7f2 [37/42] netfs: Implement bounce-buffering for unbuffered/DIO read
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260323/202603232150.smRruVIF-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260323/202603232150.smRruVIF-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/202603232150.smRruVIF-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/netfs/direct_read.c:86:20: warning: variable 'len' is uninitialized when used here [-Wuninitialized]
86 | len = round_down(len, rreq->crypto_bsize);
| ^~~
include/linux/math.h:35:28: note: expanded from macro 'round_down'
35 | #define round_down(x, y) ((x) & ~__round_mask(x, y))
| ^
fs/netfs/direct_read.c:74:12: note: initialize the variable 'len' to silence this warning
74 | size_t len;
| ^
| = 0
1 warning generated.
vim +/len +86 fs/netfs/direct_read.c
64
65 /*
66 * Prepare the buffer for the read RPC. Limits are applied and the buffer may
67 * be rounded down. Bounce bufferage will be added if necessary.
68 */
69 int netfs_prepare_unbuffered_read_buffer(struct netfs_io_subrequest *subreq,
70 unsigned int max_segs)
71 {
72 struct netfs_io_request *rreq = subreq->rreq;
73 struct netfs_io_stream *stream = &rreq->io_streams[0];
74 size_t len;
75 int ret;
76
77 bvecq_pos_set(&subreq->dispatch_pos, &stream->dispatch_cursor);
78 bvecq_pos_set(&subreq->content, &stream->dispatch_cursor);
79
80 /* Limit encrypted reads so that we don't split an encryption block
81 * across two subrequests unless the filesystem doesn't support blocks
82 * that big.
83 */
84 if (subreq->len > rreq->crypto_bsize &&
85 test_bit(NETFS_RREQ_CONTENT_ENCRYPTION, &rreq->flags)) {
> 86 len = round_down(len, rreq->crypto_bsize);
87 if (WARN_ON_ONCE(len == 0))
88 return -EIO;
89 }
90
91 /* Expand the bounce buffer so that we've got something to read into. */
92 if (test_bit(NETFS_RREQ_USE_BOUNCE_BUFFER, &rreq->flags)) {
93 ret = bvecq_buffer_add_space(&rreq->bounce_cursor,
94 &rreq->bounce_alloc_to,
95 subreq->start + subreq->len,
96 round_up(rreq->start + rreq->len,
97 rreq->crypto_bsize),
98 false, GFP_KERNEL);
99 if (ret < 0)
100 return ret;
101 }
102
103 len = bvecq_slice(&stream->dispatch_cursor, subreq->len, max_segs,
104 &subreq->nr_segs);
105
106 if (len < subreq->len) {
107 subreq->len = len;
108 trace_netfs_sreq(subreq, netfs_sreq_trace_limited);
109 }
110
111 stream->buffered -= subreq->len;
112 stream->issue_from += subreq->len;
113 return 0;
114 }
115
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* [dhowells-fs:netfs-crypt 37/42] fs/netfs/direct_read.c:86:20: warning: variable 'len' is uninitialized when used here
@ 2026-03-24 3:32 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-03-24 3:32 UTC (permalink / raw)
To: David Howells; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-crypt
head: ae7ccdf83025020c44837849de26fb4546fbf825
commit: e7c8280c95acfbbef1fc569cbb950835ab68c7f2 [37/42] netfs: Implement bounce-buffering for unbuffered/DIO read
config: x86_64-randconfig-011-20260324 (https://download.01.org/0day-ci/archive/20260324/202603241112.FsdhQVi1-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260324/202603241112.FsdhQVi1-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/202603241112.FsdhQVi1-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/netfs/direct_read.c:86:20: warning: variable 'len' is uninitialized when used here [-Wuninitialized]
86 | len = round_down(len, rreq->crypto_bsize);
| ^~~
include/linux/math.h:35:28: note: expanded from macro 'round_down'
35 | #define round_down(x, y) ((x) & ~__round_mask(x, y))
| ^
fs/netfs/direct_read.c:74:12: note: initialize the variable 'len' to silence this warning
74 | size_t len;
| ^
| = 0
1 warning generated.
vim +/len +86 fs/netfs/direct_read.c
64
65 /*
66 * Prepare the buffer for the read RPC. Limits are applied and the buffer may
67 * be rounded down. Bounce bufferage will be added if necessary.
68 */
69 int netfs_prepare_unbuffered_read_buffer(struct netfs_io_subrequest *subreq,
70 unsigned int max_segs)
71 {
72 struct netfs_io_request *rreq = subreq->rreq;
73 struct netfs_io_stream *stream = &rreq->io_streams[0];
74 size_t len;
75 int ret;
76
77 bvecq_pos_set(&subreq->dispatch_pos, &stream->dispatch_cursor);
78 bvecq_pos_set(&subreq->content, &stream->dispatch_cursor);
79
80 /* Limit encrypted reads so that we don't split an encryption block
81 * across two subrequests unless the filesystem doesn't support blocks
82 * that big.
83 */
84 if (subreq->len > rreq->crypto_bsize &&
85 test_bit(NETFS_RREQ_CONTENT_ENCRYPTION, &rreq->flags)) {
> 86 len = round_down(len, rreq->crypto_bsize);
87 if (WARN_ON_ONCE(len == 0))
88 return -EIO;
89 }
90
91 /* Expand the bounce buffer so that we've got something to read into. */
92 if (test_bit(NETFS_RREQ_USE_BOUNCE_BUFFER, &rreq->flags)) {
93 ret = bvecq_buffer_add_space(&rreq->bounce_cursor,
94 &rreq->bounce_alloc_to,
95 subreq->start + subreq->len,
96 round_up(rreq->start + rreq->len,
97 rreq->crypto_bsize),
98 false, GFP_KERNEL);
99 if (ret < 0)
100 return ret;
101 }
102
103 len = bvecq_slice(&stream->dispatch_cursor, subreq->len, max_segs,
104 &subreq->nr_segs);
105
106 if (len < subreq->len) {
107 subreq->len = len;
108 trace_netfs_sreq(subreq, netfs_sreq_trace_limited);
109 }
110
111 stream->buffered -= subreq->len;
112 stream->issue_from += subreq->len;
113 return 0;
114 }
115
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-24 3:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 3:32 [dhowells-fs:netfs-crypt 37/42] fs/netfs/direct_read.c:86:20: warning: variable 'len' is uninitialized when used here kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2026-03-23 20:57 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox