From patchwork Fri May 8 12:31:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226090 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0908C38A2A for ; Fri, 8 May 2020 13:21:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9450B24966 for ; Fri, 8 May 2020 13:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588944067; bh=CKEsIwLKe5KKKWEEfVgThjd/Hwwpw3XCwsiFwR5ZEB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Zg0dYZPWdVGKeBtu3M1v0h2Ql/jYDZeNFdt8vbeQdUZH6pYx3AaePiP6g9SD8pxGO 0gmzPEw2MNyNmLMwHm2coZ8/a0hsGbAumyj3AfCDGHupxOyVYq9dPCDRVQvcVDmElH kSlfZ7LW5R/2gESuix48tlen2k9ap3Das/au3ihM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727915AbgEHNVF (ORCPT ); Fri, 8 May 2020 09:21:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:34226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728716AbgEHMkd (ORCPT ); Fri, 8 May 2020 08:40:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A578C20731; Fri, 8 May 2020 12:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941633; bh=CKEsIwLKe5KKKWEEfVgThjd/Hwwpw3XCwsiFwR5ZEB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AYQZ0qTsbox8rK1Z4nY40N2DOXpQ7xljirVcujvtE1ca0c+VKC08mm7xTo2DEZhyw UcRpzA4cmBKxuO86m45ZpoD1FMJCV62n2UAbn2fTwu48he6zntcqJdsM25MP+hjRwh DOpd7ts0bQUVqkC25Bs7qvLP1HCbQRrGoF5YbW3o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever , Anna Schumaker Subject: [PATCH 4.4 103/312] xprtrdma: rpcrdma_bc_receive_call() should init rq_private_buf.len Date: Fri, 8 May 2020 14:31:34 +0200 Message-Id: <20200508123131.756381617@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chuck Lever commit 9f74660bcf1e4cca577be99e54bc77b5df62b508 upstream. Some NFSv4.1 OPEN requests were hanging waiting for the NFS server to finish recalling delegations. Turns out that each NFSv4.1 CB request on RDMA gets a GARBAGE_ARGS reply from the Linux client. Commit 756b9b37cfb2e3dc added a line in bc_svc_process that overwrites the incoming rq_rcv_buf's length with the value in rq_private_buf.len. But rpcrdma_bc_receive_call() does not invoke xprt_complete_bc_request(), thus rq_private_buf.len is not initialized. svc_process_common() is invoked with a zero-length RPC message, and fails. Fixes: 756b9b37cfb2e3dc ('SUNRPC: Fix callback channel') Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/xprtrdma/backchannel.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/sunrpc/xprtrdma/backchannel.c +++ b/net/sunrpc/xprtrdma/backchannel.c @@ -337,6 +337,8 @@ void rpcrdma_bc_receive_call(struct rpcr rqst->rq_reply_bytes_recvd = 0; rqst->rq_bytes_sent = 0; rqst->rq_xid = headerp->rm_xid; + + rqst->rq_private_buf.len = size; set_bit(RPC_BC_PA_IN_USE, &rqst->rq_bc_pa_state); buf = &rqst->rq_rcv_buf;