* [linux-next:master 13667/14048] drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.
@ 2021-04-29 8:58 Dan Carpenter
2021-04-29 9:05 ` Gioh Kim
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-04-29 8:58 UTC (permalink / raw)
To: kbuild, Gioh Kim
Cc: lkp, kbuild-all, Linux Memory Management List, Jens Axboe,
Jack Wang, Leon Romanovsky
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 593ef1658ecf61d3619885bdbbcfffa3d1417891
commit: fa607fcb87f6e3dca38b9984c4ccde3e36a43721 [13667/14048] block/rnbd-clt: Support polling mode for IO latency optimization
config: x86_64-randconfig-m031-20210420 (attached as .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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.
vim +/cnt +2922 drivers/infiniband/ulp/rtrs/rtrs-clt.c
fa607fcb87f6e3 Gioh Kim 2021-04-19 2901 int rtrs_clt_rdma_cq_direct(struct rtrs_clt *clt, unsigned int index)
fa607fcb87f6e3 Gioh Kim 2021-04-19 2902 {
fa607fcb87f6e3 Gioh Kim 2021-04-19 2903 int cnt;
fa607fcb87f6e3 Gioh Kim 2021-04-19 2904 struct rtrs_con *con;
fa607fcb87f6e3 Gioh Kim 2021-04-19 2905 struct rtrs_clt_sess *sess;
fa607fcb87f6e3 Gioh Kim 2021-04-19 2906 struct path_it it;
fa607fcb87f6e3 Gioh Kim 2021-04-19 2907
fa607fcb87f6e3 Gioh Kim 2021-04-19 2908 rcu_read_lock();
fa607fcb87f6e3 Gioh Kim 2021-04-19 2909 for (path_it_init(&it, clt);
fa607fcb87f6e3 Gioh Kim 2021-04-19 2910 (sess = it.next_path(&it)) && it.i < it.clt->paths_num; it.i++) {
fa607fcb87f6e3 Gioh Kim 2021-04-19 2911 if (READ_ONCE(sess->state) != RTRS_CLT_CONNECTED)
fa607fcb87f6e3 Gioh Kim 2021-04-19 2912 continue;
What if no sessions are connected? So we dont enter the loop or we
hit continue every time?
fa607fcb87f6e3 Gioh Kim 2021-04-19 2913
fa607fcb87f6e3 Gioh Kim 2021-04-19 2914 con = sess->s.con[index + 1];
fa607fcb87f6e3 Gioh Kim 2021-04-19 2915 cnt = ib_process_cq_direct(con->cq, -1);
fa607fcb87f6e3 Gioh Kim 2021-04-19 2916 if (cnt)
fa607fcb87f6e3 Gioh Kim 2021-04-19 2917 break;
fa607fcb87f6e3 Gioh Kim 2021-04-19 2918 }
fa607fcb87f6e3 Gioh Kim 2021-04-19 2919 path_it_deinit(&it);
fa607fcb87f6e3 Gioh Kim 2021-04-19 2920 rcu_read_unlock();
fa607fcb87f6e3 Gioh Kim 2021-04-19 2921
fa607fcb87f6e3 Gioh Kim 2021-04-19 @2922 return cnt;
fa607fcb87f6e3 Gioh Kim 2021-04-19 2923 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [linux-next:master 13667/14048] drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.
2021-04-29 8:58 [linux-next:master 13667/14048] drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt' Dan Carpenter
@ 2021-04-29 9:05 ` Gioh Kim
2021-04-29 9:30 ` Gioh Kim
0 siblings, 1 reply; 3+ messages in thread
From: Gioh Kim @ 2021-04-29 9:05 UTC (permalink / raw)
To: Dan Carpenter
Cc: kbuild, Gioh Kim, kbuild test robot, kbuild-all,
Linux Memory Management List, Jens Axboe, Jack Wang,
Leon Romanovsky
On Thu, Apr 29, 2021 at 10:58 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 593ef1658ecf61d3619885bdbbcfffa3d1417891
> commit: fa607fcb87f6e3dca38b9984c4ccde3e36a43721 [13667/14048] block/rnbd-clt: Support polling mode for IO latency optimization
> config: x86_64-randconfig-m031-20210420 (attached as .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 <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> smatch warnings:
> drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.
>
> vim +/cnt +2922 drivers/infiniband/ulp/rtrs/rtrs-clt.c
>
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2901 int rtrs_clt_rdma_cq_direct(struct rtrs_clt *clt, unsigned int index)
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2902 {
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2903 int cnt;
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2904 struct rtrs_con *con;
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2905 struct rtrs_clt_sess *sess;
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2906 struct path_it it;
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2907
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2908 rcu_read_lock();
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2909 for (path_it_init(&it, clt);
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2910 (sess = it.next_path(&it)) && it.i < it.clt->paths_num; it.i++) {
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2911 if (READ_ONCE(sess->state) != RTRS_CLT_CONNECTED)
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2912 continue;
>
> What if no sessions are connected? So we dont enter the loop or we
> hit continue every time?
Hi Dan,
I just finished a internal process for the fix of that issue.
In short, I would like to initialize cnt with -1.
So rtrs_clt_rdma_cq_direct will return -1 if there is no session.
And the block layer will not call rtrs_clt_rdma_cq_direct again
because the return value is negative.
I am going to send the patch today with the tags above.
Thank you very much.
>
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2913
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2914 con = sess->s.con[index + 1];
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2915 cnt = ib_process_cq_direct(con->cq, -1);
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2916 if (cnt)
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2917 break;
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2918 }
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2919 path_it_deinit(&it);
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2920 rcu_read_unlock();
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2921
> fa607fcb87f6e3 Gioh Kim 2021-04-19 @2922 return cnt;
> fa607fcb87f6e3 Gioh Kim 2021-04-19 2923 }
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [linux-next:master 13667/14048] drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.
2021-04-29 9:05 ` Gioh Kim
@ 2021-04-29 9:30 ` Gioh Kim
0 siblings, 0 replies; 3+ messages in thread
From: Gioh Kim @ 2021-04-29 9:30 UTC (permalink / raw)
To: Dan Carpenter
Cc: kbuild, Gioh Kim, kbuild test robot, kbuild-all,
Linux Memory Management List, Jens Axboe, Jack Wang,
Leon Romanovsky
On Thu, Apr 29, 2021 at 11:05 AM Gioh Kim <gi-oh.kim@ionos.com> wrote:
>
> On Thu, Apr 29, 2021 at 10:58 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head: 593ef1658ecf61d3619885bdbbcfffa3d1417891
> > commit: fa607fcb87f6e3dca38b9984c4ccde3e36a43721 [13667/14048] block/rnbd-clt: Support polling mode for IO latency optimization
> > config: x86_64-randconfig-m031-20210420 (attached as .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 <lkp@intel.com>
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > smatch warnings:
> > drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt'.
> >
> > vim +/cnt +2922 drivers/infiniband/ulp/rtrs/rtrs-clt.c
> >
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2901 int rtrs_clt_rdma_cq_direct(struct rtrs_clt *clt, unsigned int index)
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2902 {
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2903 int cnt;
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2904 struct rtrs_con *con;
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2905 struct rtrs_clt_sess *sess;
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2906 struct path_it it;
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2907
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2908 rcu_read_lock();
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2909 for (path_it_init(&it, clt);
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2910 (sess = it.next_path(&it)) && it.i < it.clt->paths_num; it.i++) {
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2911 if (READ_ONCE(sess->state) != RTRS_CLT_CONNECTED)
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2912 continue;
> >
> > What if no sessions are connected? So we dont enter the loop or we
> > hit continue every time?
>
> Hi Dan,
>
> I just finished a internal process for the fix of that issue.
> In short, I would like to initialize cnt with -1.
> So rtrs_clt_rdma_cq_direct will return -1 if there is no session.
> And the block layer will not call rtrs_clt_rdma_cq_direct again
> because the return value is negative.
>
> I am going to send the patch today with the tags above.
> Thank you very much.
Hi Dan,
FYI, I just sent a patch including the tags.
>
> >
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2913
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2914 con = sess->s.con[index + 1];
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2915 cnt = ib_process_cq_direct(con->cq, -1);
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2916 if (cnt)
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2917 break;
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2918 }
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2919 path_it_deinit(&it);
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2920 rcu_read_unlock();
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2921
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 @2922 return cnt;
> > fa607fcb87f6e3 Gioh Kim 2021-04-19 2923 }
> >
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-29 9:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 8:58 [linux-next:master 13667/14048] drivers/infiniband/ulp/rtrs/rtrs-clt.c:2922 rtrs_clt_rdma_cq_direct() error: uninitialized symbol 'cnt' Dan Carpenter
2021-04-29 9:05 ` Gioh Kim
2021-04-29 9:30 ` Gioh Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox