[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1D2A804A-9BEC-4D34-AF01-960F35E297E7@oracle.com>
Date: Thu, 13 Jul 2017 13:53:10 -0400
From: Chuck Lever <chuck.lever@...cle.com>
To: Colin King <colin.king@...onical.com>
Cc: Trond Myklebust <trond.myklebust@...marydata.com>,
Anna Schumaker <anna.schumaker@...app.com>,
"J. Bruce Fields" <bfields@...ldses.org>,
Jeff Layton <jlayton@...chiereds.net>,
"David S . Miller" <davem@...emloft.net>,
Sagi Grimberg <sagi@...mberg.me>,
Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH][net-next] svcrdma: fix an incorrect check on -E2BIG and -EINVAL
> On Jul 13, 2017, at 1:51 PM, Colin King <colin.king@...onical.com> wrote:
>
> From: Colin Ian King <colin.king@...onical.com>
>
> The current check will always be true and will always jump to
> err1, this looks dubious to me. I believe && should be used
> instead of ||.
>
> Detected by CoverityScan, CID#1450120 ("Logically Dead Code")
>
> Fixes: 107c1d0a991a ("svcrdma: Avoid Send Queue overflow")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
Reviewed-by: Chuck Lever <chuck.lever@...cle.com>
Dan reported this today, and I have a similar patch in my
"pending for-rc" series. This one works too.
> ---
> net/sunrpc/xprtrdma/svc_rdma_sendto.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
> index 19fd01e4b690..7c3a211e0e9a 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
> @@ -684,7 +684,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
> return 0;
>
> err2:
> - if (ret != -E2BIG || ret != -EINVAL)
> + if (ret != -E2BIG && ret != -EINVAL)
> goto err1;
>
> ret = svc_rdma_post_recv(rdma, GFP_KERNEL);
> --
> 2.11.0
>
--
Chuck Lever
Powered by blists - more mailing lists