All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v1 2/7] SUNRPC: Move xpt_mutex into socket xpo_sendto methods
Date: Sat, 02 May 2020 20:26:33 +0800	[thread overview]
Message-ID: <202005022012.qPRjeeqK%lkp@intel.com> (raw)
In-Reply-To: <20200501173332.3798.28627.stgit@klimt.1015granger.net>

[-- Attachment #1: Type: text/plain, Size: 5675 bytes --]

Hi Chuck,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v5.7-rc3]
[also build test WARNING on next-20200501]
[cannot apply to nfs/linux-next nfsd/nfsd-next tip/perf/core]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Chuck-Lever/RPC-server-tracepoints/20200502-040815
base:    6a8b55ed4056ea5559ebe4f6a4b247f627870d4c
config: x86_64-randconfig-b002-20200502 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 30ddd4ce19316fd2a8a50c5bc511433c87ecb95c)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> net/sunrpc/xprtrdma/svc_rdma_sendto.c:871:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (svc_xprt_is_dead(xprt))
               ^~~~~~~~~~~~~~~~~~~~~~
   net/sunrpc/xprtrdma/svc_rdma_sendto.c:940:35: note: uninitialized use occurs here
           trace_svcrdma_send_failed(rqstp, ret);
                                            ^~~
   net/sunrpc/xprtrdma/svc_rdma_sendto.c:871:2: note: remove the 'if' if its condition is always false
           if (svc_xprt_is_dead(xprt))
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/sunrpc/xprtrdma/svc_rdma_sendto.c:869:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0
   1 warning generated.

vim +871 net/sunrpc/xprtrdma/svc_rdma_sendto.c

   844	
   845	/**
   846	 * svc_rdma_sendto - Transmit an RPC reply
   847	 * @rqstp: processed RPC request, reply XDR already in ::rq_res
   848	 *
   849	 * Any resources still associated with @rqstp are released upon return.
   850	 * If no reply message was possible, the connection is closed.
   851	 *
   852	 * Returns:
   853	 *	%0 if an RPC reply has been successfully posted,
   854	 *	%-ENOMEM if a resource shortage occurred (connection is lost),
   855	 *	%-ENOTCONN if posting failed (connection is lost).
   856	 */
   857	int svc_rdma_sendto(struct svc_rqst *rqstp)
   858	{
   859		struct svc_xprt *xprt = rqstp->rq_xprt;
   860		struct svcxprt_rdma *rdma =
   861			container_of(xprt, struct svcxprt_rdma, sc_xprt);
   862		struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt;
   863		__be32 *rdma_argp = rctxt->rc_recv_buf;
   864		__be32 *wr_lst = rctxt->rc_write_list;
   865		__be32 *rp_ch = rctxt->rc_reply_chunk;
   866		struct xdr_buf *xdr = &rqstp->rq_res;
   867		struct svc_rdma_send_ctxt *sctxt;
   868		__be32 *p;
   869		int ret;
   870	
 > 871		if (svc_xprt_is_dead(xprt))
   872			goto err0;
   873	
   874		ret = -ENOMEM;
   875		sctxt = svc_rdma_send_ctxt_get(rdma);
   876		if (!sctxt)
   877			goto err0;
   878	
   879		p = xdr_reserve_space(&sctxt->sc_stream,
   880				      rpcrdma_fixed_maxsz * sizeof(*p));
   881		if (!p)
   882			goto err0;
   883		*p++ = *rdma_argp;
   884		*p++ = *(rdma_argp + 1);
   885		*p++ = rdma->sc_fc_credits;
   886		*p   = rp_ch ? rdma_nomsg : rdma_msg;
   887	
   888		if (svc_rdma_encode_read_list(sctxt) < 0)
   889			goto err0;
   890		if (wr_lst) {
   891			/* XXX: Presume the client sent only one Write chunk */
   892			unsigned long offset;
   893			unsigned int length;
   894	
   895			if (rctxt->rc_read_payload_length) {
   896				offset = rctxt->rc_read_payload_offset;
   897				length = rctxt->rc_read_payload_length;
   898			} else {
   899				offset = xdr->head[0].iov_len;
   900				length = xdr->page_len;
   901			}
   902			ret = svc_rdma_send_write_chunk(rdma, wr_lst, xdr, offset,
   903							length);
   904			if (ret < 0)
   905				goto err2;
   906			if (svc_rdma_encode_write_list(rctxt, sctxt, length) < 0)
   907				goto err0;
   908		} else {
   909			if (xdr_stream_encode_item_absent(&sctxt->sc_stream) < 0)
   910				goto err0;
   911		}
   912		if (rp_ch) {
   913			ret = svc_rdma_send_reply_chunk(rdma, rctxt, &rqstp->rq_res);
   914			if (ret < 0)
   915				goto err2;
   916			if (svc_rdma_encode_reply_chunk(rctxt, sctxt, ret) < 0)
   917				goto err0;
   918		} else {
   919			if (xdr_stream_encode_item_absent(&sctxt->sc_stream) < 0)
   920				goto err0;
   921		}
   922	
   923		ret = svc_rdma_send_reply_msg(rdma, sctxt, rctxt, rqstp);
   924		if (ret < 0)
   925			goto err1;
   926		return 0;
   927	
   928	 err2:
   929		if (ret != -E2BIG && ret != -EINVAL)
   930			goto err1;
   931	
   932		ret = svc_rdma_send_error_msg(rdma, sctxt, rqstp);
   933		if (ret < 0)
   934			goto err1;
   935		return 0;
   936	
   937	 err1:
   938		svc_rdma_send_ctxt_put(rdma, sctxt);
   939	 err0:
   940		trace_svcrdma_send_failed(rqstp, ret);
   941		set_bit(XPT_CLOSE, &xprt->xpt_flags);
   942		return -ENOTCONN;
   943	}
   944	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30538 bytes --]

  reply	other threads:[~2020-05-02 12:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 17:33 [PATCH v1 0/7] RPC server tracepoints Chuck Lever
2020-05-01 17:33 ` [PATCH v1 1/7] SUNRPC: svc_show_status() macro needs enum definitions Chuck Lever
2020-05-01 17:33 ` [PATCH v1 2/7] SUNRPC: Move xpt_mutex into socket xpo_sendto methods Chuck Lever
2020-05-02 12:26   ` kbuild test robot [this message]
2020-05-01 17:33 ` [PATCH v1 3/7] svcrdma: Displayed remote IP address should match stored address Chuck Lever
2020-05-01 17:33 ` [PATCH v1 4/7] SUNRPC: Remove kernel memory address from svc_xprt tracepoints Chuck Lever
2020-05-01 17:33 ` [PATCH v1 5/7] SUNRPC: Tracepoint to record errors in svc_xpo_create() Chuck Lever
2020-05-01 17:33 ` [PATCH v1 6/7] SUNRPC: Trace a few more generic svc_xprt events Chuck Lever
2020-05-01 17:33 ` [PATCH v1 7/7] svcrdma: Add tracepoints to report ->xpo_accept failures Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202005022012.qPRjeeqK%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.