* [axboe-block:for-6.15/io_uring 43/57] io_uring/rw.c:299 io_prep_rw() error: uninitialized symbol 'ret'.
@ 2025-02-27 4:08 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-02-27 4:08 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Pavel Begunkov <asml.silence@gmail.com>
CC: Jens Axboe <axboe@kernel.dk>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-6.15/io_uring
head: 047fa0ba8f1bed6b1c5d88e31c4fd187de16dbc1
commit: 61ed48b5fc63d1c6d9c3eb59ed2b46a2cbfc6039 [43/57] io_uring/rw: open code io_prep_rw_setup()
:::::: branch date: 4 hours ago
:::::: commit date: 2 days ago
config: i386-randconfig-141-20250226 (https://download.01.org/0day-ci/archive/20250227/202502271201.3Eaa0Ych-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202502271201.3Eaa0Ych-lkp@intel.com/
smatch warnings:
io_uring/rw.c:299 io_prep_rw() error: uninitialized symbol 'ret'.
vim +/ret +299 io_uring/rw.c
a9165b83c1937e Jens Axboe 2024-03-18 247
a9165b83c1937e Jens Axboe 2024-03-18 248 static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
a9165b83c1937e Jens Axboe 2024-03-18 249 int ddir, bool do_import)
f3b44f92e59a80 Jens Axboe 2022-06-13 250 {
f2ccb5aed7bce1 Stefan Metzmacher 2022-08-11 251 struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw);
f3b44f92e59a80 Jens Axboe 2022-06-13 252 unsigned ioprio;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 253 u64 attr_type_mask;
f3b44f92e59a80 Jens Axboe 2022-06-13 254 int ret;
f3b44f92e59a80 Jens Axboe 2022-06-13 255
c72282dd865ee6 Pavel Begunkov 2025-02-24 256 if (io_rw_alloc_async(req))
c72282dd865ee6 Pavel Begunkov 2025-02-24 257 return -ENOMEM;
c72282dd865ee6 Pavel Begunkov 2025-02-24 258
f3b44f92e59a80 Jens Axboe 2022-06-13 259 rw->kiocb.ki_pos = READ_ONCE(sqe->off);
f3b44f92e59a80 Jens Axboe 2022-06-13 260 /* used for fixed read/write too - just read unconditionally */
f3b44f92e59a80 Jens Axboe 2022-06-13 261 req->buf_index = READ_ONCE(sqe->buf_index);
f3b44f92e59a80 Jens Axboe 2022-06-13 262
f3b44f92e59a80 Jens Axboe 2022-06-13 263 ioprio = READ_ONCE(sqe->ioprio);
f3b44f92e59a80 Jens Axboe 2022-06-13 264 if (ioprio) {
f3b44f92e59a80 Jens Axboe 2022-06-13 265 ret = ioprio_check_cap(ioprio);
f3b44f92e59a80 Jens Axboe 2022-06-13 266 if (ret)
f3b44f92e59a80 Jens Axboe 2022-06-13 267 return ret;
f3b44f92e59a80 Jens Axboe 2022-06-13 268
f3b44f92e59a80 Jens Axboe 2022-06-13 269 rw->kiocb.ki_ioprio = ioprio;
f3b44f92e59a80 Jens Axboe 2022-06-13 270 } else {
f3b44f92e59a80 Jens Axboe 2022-06-13 271 rw->kiocb.ki_ioprio = get_current_ioprio();
f3b44f92e59a80 Jens Axboe 2022-06-13 272 }
099ada2c87260e Jens Axboe 2023-07-08 273 rw->kiocb.dio_complete = NULL;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 274 rw->kiocb.ki_flags = 0;
f3b44f92e59a80 Jens Axboe 2022-06-13 275
f3b44f92e59a80 Jens Axboe 2022-06-13 276 rw->addr = READ_ONCE(sqe->addr);
f3b44f92e59a80 Jens Axboe 2022-06-13 277 rw->len = READ_ONCE(sqe->len);
f3b44f92e59a80 Jens Axboe 2022-06-13 278 rw->flags = READ_ONCE(sqe->rw_flags);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 279
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 280 if (do_import && !io_do_buffer_select(req)) {
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 281 struct io_async_rw *io = req->async_data;
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 282
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 283 ret = io_import_rw_buffer(ddir, req, io, 0);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 284 if (unlikely(ret))
59a7d12a7fb5ab Anuj Gupta 2024-11-28 285 return ret;
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 286 }
59a7d12a7fb5ab Anuj Gupta 2024-11-28 287
59a7d12a7fb5ab Anuj Gupta 2024-11-28 288 attr_type_mask = READ_ONCE(sqe->attr_type_mask);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 289 if (attr_type_mask) {
59a7d12a7fb5ab Anuj Gupta 2024-11-28 290 u64 attr_ptr;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 291
59a7d12a7fb5ab Anuj Gupta 2024-11-28 292 /* only PI attribute is supported currently */
59a7d12a7fb5ab Anuj Gupta 2024-11-28 293 if (attr_type_mask != IORING_RW_ATTR_FLAG_PI)
59a7d12a7fb5ab Anuj Gupta 2024-11-28 294 return -EINVAL;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 295
59a7d12a7fb5ab Anuj Gupta 2024-11-28 296 attr_ptr = READ_ONCE(sqe->attr_ptr);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 297 ret = io_prep_rw_pi(req, rw, ddir, attr_ptr, attr_type_mask);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 298 }
59a7d12a7fb5ab Anuj Gupta 2024-11-28 @299 return ret;
a9165b83c1937e Jens Axboe 2024-03-18 300 }
a9165b83c1937e Jens Axboe 2024-03-18 301
:::::: The code at line 299 was first introduced by commit
:::::: 59a7d12a7fb5ab24efa893e6980a00ffc090c777 io_uring: introduce attributes for read/write and PI support
:::::: TO: Anuj Gupta <anuj20.g@samsung.com>
:::::: CC: Jens Axboe <axboe@kernel.dk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread* [axboe-block:for-6.15/io_uring 43/57] io_uring/rw.c:299 io_prep_rw() error: uninitialized symbol 'ret'.
@ 2025-02-27 5:56 Dan Carpenter
2025-02-27 10:08 ` Pavel Begunkov
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2025-02-27 5:56 UTC (permalink / raw)
To: oe-kbuild, Pavel Begunkov; +Cc: lkp, oe-kbuild-all, Jens Axboe
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-6.15/io_uring
head: 047fa0ba8f1bed6b1c5d88e31c4fd187de16dbc1
commit: 61ed48b5fc63d1c6d9c3eb59ed2b46a2cbfc6039 [43/57] io_uring/rw: open code io_prep_rw_setup()
config: i386-randconfig-141-20250226 (https://download.01.org/0day-ci/archive/20250227/202502271201.3Eaa0Ych-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202502271201.3Eaa0Ych-lkp@intel.com/
smatch warnings:
io_uring/rw.c:299 io_prep_rw() error: uninitialized symbol 'ret'.
vim +/ret +299 io_uring/rw.c
a9165b83c1937e Jens Axboe 2024-03-18 248 static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
a9165b83c1937e Jens Axboe 2024-03-18 249 int ddir, bool do_import)
f3b44f92e59a80 Jens Axboe 2022-06-13 250 {
f2ccb5aed7bce1 Stefan Metzmacher 2022-08-11 251 struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw);
f3b44f92e59a80 Jens Axboe 2022-06-13 252 unsigned ioprio;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 253 u64 attr_type_mask;
f3b44f92e59a80 Jens Axboe 2022-06-13 254 int ret;
f3b44f92e59a80 Jens Axboe 2022-06-13 255
c72282dd865ee6 Pavel Begunkov 2025-02-24 256 if (io_rw_alloc_async(req))
c72282dd865ee6 Pavel Begunkov 2025-02-24 257 return -ENOMEM;
c72282dd865ee6 Pavel Begunkov 2025-02-24 258
f3b44f92e59a80 Jens Axboe 2022-06-13 259 rw->kiocb.ki_pos = READ_ONCE(sqe->off);
f3b44f92e59a80 Jens Axboe 2022-06-13 260 /* used for fixed read/write too - just read unconditionally */
f3b44f92e59a80 Jens Axboe 2022-06-13 261 req->buf_index = READ_ONCE(sqe->buf_index);
f3b44f92e59a80 Jens Axboe 2022-06-13 262
f3b44f92e59a80 Jens Axboe 2022-06-13 263 ioprio = READ_ONCE(sqe->ioprio);
f3b44f92e59a80 Jens Axboe 2022-06-13 264 if (ioprio) {
f3b44f92e59a80 Jens Axboe 2022-06-13 265 ret = ioprio_check_cap(ioprio);
f3b44f92e59a80 Jens Axboe 2022-06-13 266 if (ret)
f3b44f92e59a80 Jens Axboe 2022-06-13 267 return ret;
f3b44f92e59a80 Jens Axboe 2022-06-13 268
f3b44f92e59a80 Jens Axboe 2022-06-13 269 rw->kiocb.ki_ioprio = ioprio;
f3b44f92e59a80 Jens Axboe 2022-06-13 270 } else {
f3b44f92e59a80 Jens Axboe 2022-06-13 271 rw->kiocb.ki_ioprio = get_current_ioprio();
f3b44f92e59a80 Jens Axboe 2022-06-13 272 }
099ada2c87260e Jens Axboe 2023-07-08 273 rw->kiocb.dio_complete = NULL;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 274 rw->kiocb.ki_flags = 0;
f3b44f92e59a80 Jens Axboe 2022-06-13 275
f3b44f92e59a80 Jens Axboe 2022-06-13 276 rw->addr = READ_ONCE(sqe->addr);
f3b44f92e59a80 Jens Axboe 2022-06-13 277 rw->len = READ_ONCE(sqe->len);
f3b44f92e59a80 Jens Axboe 2022-06-13 278 rw->flags = READ_ONCE(sqe->rw_flags);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 279
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 280 if (do_import && !io_do_buffer_select(req)) {
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 281 struct io_async_rw *io = req->async_data;
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 282
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 283 ret = io_import_rw_buffer(ddir, req, io, 0);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 284 if (unlikely(ret))
59a7d12a7fb5ab Anuj Gupta 2024-11-28 285 return ret;
61ed48b5fc63d1 Pavel Begunkov 2025-02-24 286 }
59a7d12a7fb5ab Anuj Gupta 2024-11-28 287
59a7d12a7fb5ab Anuj Gupta 2024-11-28 288 attr_type_mask = READ_ONCE(sqe->attr_type_mask);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 289 if (attr_type_mask) {
59a7d12a7fb5ab Anuj Gupta 2024-11-28 290 u64 attr_ptr;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 291
59a7d12a7fb5ab Anuj Gupta 2024-11-28 292 /* only PI attribute is supported currently */
59a7d12a7fb5ab Anuj Gupta 2024-11-28 293 if (attr_type_mask != IORING_RW_ATTR_FLAG_PI)
59a7d12a7fb5ab Anuj Gupta 2024-11-28 294 return -EINVAL;
59a7d12a7fb5ab Anuj Gupta 2024-11-28 295
59a7d12a7fb5ab Anuj Gupta 2024-11-28 296 attr_ptr = READ_ONCE(sqe->attr_ptr);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 297 ret = io_prep_rw_pi(req, rw, ddir, attr_ptr, attr_type_mask);
59a7d12a7fb5ab Anuj Gupta 2024-11-28 298 }
59a7d12a7fb5ab Anuj Gupta 2024-11-28 @299 return ret;
Smatch is concerned that we could hit all three else statements.
a9165b83c1937e Jens Axboe 2024-03-18 300 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-27 14:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-27 4:08 [axboe-block:for-6.15/io_uring 43/57] io_uring/rw.c:299 io_prep_rw() error: uninitialized symbol 'ret' kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2025-02-27 5:56 Dan Carpenter
2025-02-27 10:08 ` Pavel Begunkov
2025-02-27 14:18 ` Jens Axboe
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.