CC: [email protected]
TO: [email protected]
TO: Guenter Roeck <[email protected]>

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel 
chromeos-5.4
head:   56f704f1ca6f7dcdae5e9b7e2f1b4c2695e7fa94
commit: b75748e5171e8f9f741eb5018dfb479da9f3f834 [74/85] BACKPORT: io_uring: 
replace workqueue usage with io-wq
:::::: branch date: 
:::::: commit date: 4 hours ago
config: m68k-randconfig-c003-20210129 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0

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


"coccinelle warnings: (new ones prefixed by >>)"
>> fs/io-wq.c:656:2-6: ERROR: invalid reference to the index variable of the 
>> iterator on line 646

vim +656 fs/io-wq.c

d9415202b39091 Jens Axboe 2019-10-22  631  
d9415202b39091 Jens Axboe 2019-10-22  632  static enum io_wq_cancel 
io_wqe_cancel_work(struct io_wqe *wqe,
d9415202b39091 Jens Axboe 2019-10-22  633                                       
    struct io_wq_work *cwork)
d9415202b39091 Jens Axboe 2019-10-22  634  {
d9415202b39091 Jens Axboe 2019-10-22  635       struct io_wq_work *work;
d9415202b39091 Jens Axboe 2019-10-22  636       bool found = false;
d9415202b39091 Jens Axboe 2019-10-22  637  
d9415202b39091 Jens Axboe 2019-10-22  638       cwork->flags |= 
IO_WQ_WORK_CANCEL;
d9415202b39091 Jens Axboe 2019-10-22  639  
d9415202b39091 Jens Axboe 2019-10-22  640       /*
d9415202b39091 Jens Axboe 2019-10-22  641        * First check pending list, if 
we're lucky we can just remove it
d9415202b39091 Jens Axboe 2019-10-22  642        * from there. CANCEL_OK means 
that the work is returned as-new,
d9415202b39091 Jens Axboe 2019-10-22  643        * no completion will be posted 
for it.
d9415202b39091 Jens Axboe 2019-10-22  644        */
d9415202b39091 Jens Axboe 2019-10-22  645       spin_lock_irq(&wqe->lock);
d9415202b39091 Jens Axboe 2019-10-22 @646       list_for_each_entry(work, 
&wqe->work_list, list) {
d9415202b39091 Jens Axboe 2019-10-22  647               if (work == cwork) {
d9415202b39091 Jens Axboe 2019-10-22  648                       
list_del(&work->list);
d9415202b39091 Jens Axboe 2019-10-22  649                       found = true;
d9415202b39091 Jens Axboe 2019-10-22  650                       break;
d9415202b39091 Jens Axboe 2019-10-22  651               }
d9415202b39091 Jens Axboe 2019-10-22  652       }
d9415202b39091 Jens Axboe 2019-10-22  653       spin_unlock_irq(&wqe->lock);
d9415202b39091 Jens Axboe 2019-10-22  654  
d9415202b39091 Jens Axboe 2019-10-22  655       if (found) {
d9415202b39091 Jens Axboe 2019-10-22 @656               work->flags |= 
IO_WQ_WORK_CANCEL;
d9415202b39091 Jens Axboe 2019-10-22  657               work->func(&work);
d9415202b39091 Jens Axboe 2019-10-22  658               return IO_WQ_CANCEL_OK;
d9415202b39091 Jens Axboe 2019-10-22  659       }
d9415202b39091 Jens Axboe 2019-10-22  660  
d9415202b39091 Jens Axboe 2019-10-22  661       /*
d9415202b39091 Jens Axboe 2019-10-22  662        * Now check if a free (going 
busy) or busy worker has the work
d9415202b39091 Jens Axboe 2019-10-22  663        * currently running. If we 
find it there, we'll return CANCEL_RUNNING
d9415202b39091 Jens Axboe 2019-10-22  664        * as an indication that we 
attempte to signal cancellation. The
d9415202b39091 Jens Axboe 2019-10-22  665        * completion will run normally 
in this case.
d9415202b39091 Jens Axboe 2019-10-22  666        */
d9415202b39091 Jens Axboe 2019-10-22  667       rcu_read_lock();
d9415202b39091 Jens Axboe 2019-10-22  668       found = 
io_wq_for_each_worker(wqe, &wqe->free_list, io_wq_worker_cancel,
d9415202b39091 Jens Axboe 2019-10-22  669                                       
cwork);
d9415202b39091 Jens Axboe 2019-10-22  670       if (found)
d9415202b39091 Jens Axboe 2019-10-22  671               goto done;
d9415202b39091 Jens Axboe 2019-10-22  672  
d9415202b39091 Jens Axboe 2019-10-22  673       found = 
io_wq_for_each_worker(wqe, &wqe->busy_list, io_wq_worker_cancel,
d9415202b39091 Jens Axboe 2019-10-22  674                                       
cwork);
d9415202b39091 Jens Axboe 2019-10-22  675  done:
d9415202b39091 Jens Axboe 2019-10-22  676       rcu_read_unlock();
d9415202b39091 Jens Axboe 2019-10-22  677       return found ? 
IO_WQ_CANCEL_RUNNING : IO_WQ_CANCEL_NOTFOUND;
d9415202b39091 Jens Axboe 2019-10-22  678  }
d9415202b39091 Jens Axboe 2019-10-22  679  

:::::: The code at line 656 was first introduced by commit
:::::: d9415202b39091a078aeca3c9a3b60436dd1cc1d UPSTREAM: io-wq: small 
threadpool implementation for io_uring

:::::: TO: Jens Axboe <[email protected]>
:::::: CC: Commit Bot <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to