Skip to contentSkip to conversation

linux-next: build warning after merge of the rdma tree

DISCUSSION Stephen Rothwell 3 participants 4 messages Jul 26, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the rdma tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

net/sunrpc/xprtrdma/svc_rdma_rw.c: In function 'svc_rdma_post_chunk_ctxt':
net/sunrpc/xprtrdma/svc_rdma_rw.c:350:5: warning: 'bad_wr' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (bad_wr != first_wr)

     ^

Introduced by commit

ed288d74a9e5 ("net/xprtrdma: Simplify ib_post_(send|recv|srq_recv)() calls")

This is an actual problem.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 9 lines · Stephen Rothwell

Hi all,

After merging the rdma tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

net/sunrpc/xprtrdma/svc_rdma_rw.c: In function 'svc_rdma_post_chunk_ctxt':
net/sunrpc/xprtrdma/svc_rdma_rw.c:350:5: warning: 'bad_wr' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (bad_wr != first_wr)

     ^

Huh. I'm quite surprised 0-day build service didn't warn on this.

Quoted 5 lines

Introduced by commit

ed288d74a9e5 ("net/xprtrdma: Simplify ib_post_(send|recv|srq_recv)() calls")

This is an actual problem.

Yes, for sure. Bart?

Thanks,
Jason

#2 lore raw
Quoted 13 lines · Jason Gunthorpe
Quoted 9 lines · Stephen Rothwell

Hi all,

After merging the rdma tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

net/sunrpc/xprtrdma/svc_rdma_rw.c: In function 'svc_rdma_post_chunk_ctxt':
net/sunrpc/xprtrdma/svc_rdma_rw.c:350:5: warning: 'bad_wr' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (bad_wr != first_wr)

     ^

Huh. I'm quite surprised 0-day build service didn't warn on this.

Quoted 7 lines
Quoted 5 lines

Introduced by commit

ed288d74a9e5 ("net/xprtrdma: Simplify ib_post_(send|recv|srq_recv)() calls")

This is an actual problem.

Yes, for sure. Bart?

Thanks Stephen for having reported this. I propose to revert the changes in net/sunrpc/xprtrdma/svc_rdma_rw.c. Jason, do you want me to submit the below as a formal patch?

Thanks,

Bart.

net/sunrpc/xprtrdma/svc_rdma_rw.c +0 -0
index 80975427f523..ce3ea8419704 100644

--- a/net/sunrpc/xprtrdma/svc_rdma_rw.c
+-+-+- b/net/sunrpc/xprtrdma/svc_rdma_rw.c
@@ -329,7 +-329,7 @@ static int svc_rdma_post_chunk_ctxt(struct svc_rdma_chunk_ctxt *cc)
do {
if (atomic_sub_return(cc->cc_sqecount,
&rdma->sc_sq_avail) > 0) {
- ret = ib_post_send(rdma->sc_qp, first_wr, NULL);
+- ret = ib_post_send(rdma->sc_qp, first_wr, &bad_wr);
trace_svcrdma_post_rw(&cc->cc_cqe,
cc->cc_sqecount, ret);
if (ret)

#3 lore raw
Quoted 18 lines · Bart Van Assche
Quoted 17 lines · Jason Gunthorpe
Quoted 9 lines · Stephen Rothwell

Hi all,

After merging the rdma tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

net/sunrpc/xprtrdma/svc_rdma_rw.c: In function 'svc_rdma_post_chunk_ctxt':
net/sunrpc/xprtrdma/svc_rdma_rw.c:350:5: warning: 'bad_wr' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (bad_wr != first_wr)

     ^

Huh. I'm quite surprised 0-day build service didn't warn on this.

Quoted 4 lines

Introduced by commit

ed288d74a9e5 ("net/xprtrdma: Simplify ib_post_(send|recv|srq_recv)() calls")

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

This is an actual problem.

Yes, for sure. Bart?

Thanks Stephen for having reported this. I propose to revert the changes in net/sunrpc/xprtrdma/svc_rdma_rw.c. Jason, do you want me to submit the below as a formal patch?

I applied the below.. Please let me know if there is an error.

Thanks,
Jason

commit 5d85a822fae2b484f26ddb09815063a88962a0cb

Author: Jason Gunthorpe <[email protected]>
Date:   Thu Jul 26 11:36:50 2018 -0600

net/xprtrdma: Restore needed argument to ib_post_send

The call in svc_rdma_post_chunk_ctxt() does actually use bad_wr.

Fixes ed288d74a9e5 ("net/xprtrdma: Simplify ib_post_(send|recv|srq_recv)() calls")
net/sunrpc/xprtrdma/svc_rdma_rw.c +1 -1
index 80975427f5235f..ce3ea841970483 100644
@@ -329,7 +329,7 @@ static int svc_rdma_post_chunk_ctxt(struct svc_rdma_chunk_ctxt *cc)
 	do {
 		if (atomic_sub_return(cc->cc_sqecount,
 				      &rdma->sc_sq_avail) > 0) {
-			ret = ib_post_send(rdma->sc_qp, first_wr, NULL);
+			ret = ib_post_send(rdma->sc_qp, first_wr, &bad_wr);
 			trace_svcrdma_post_rw(&cc->cc_cqe,
 					      cc->cc_sqecount, ret);
 			if (ret)