Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2283741ybl; Thu, 19 Dec 2019 11:00:11 -0800 (PST) X-Google-Smtp-Source: APXvYqzngYAsGhcUsmNKRgUli6QQ7Aaegf3cfOTppIlKyE4BvANwpAf68Nlgg8IIuajmNmek+4Uv X-Received: by 2002:a9d:133:: with SMTP id 48mr10030385otu.15.1576782011103; Thu, 19 Dec 2019 11:00:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782011; cv=none; d=google.com; s=arc-20160816; b=FoB2ZwP5F4gCfLdV0OaxwqQdoAAnWW7qdghE9kZPsh0JyeC0oe8eB8fqEhgNUCCoCa 3Q9NPDcxvmzq/5vpoOj82vYLUZ76OZokU1fxL7hR6ZFfwQDU+h2Mo5mKDZRXKs08hiY+ lKluT26eaYH51lTYGf+SJ+qymz10VDLM+Evs8cSsZrDrmiy2HVKZ8HdxkpiSlVqA4ZVP AraHdlYPd+bwKEbVhOLr0YsZJdlMuHuerTp9+eO3B3koLAAbsj4jexT0H1a1zTe8O7qH aaqr8toHoVWfGcpwXIddWKZ3yD1wgYw8GaSDgxfBabawJSjyPmqAhl4uwd+vli1VHPZ/ Nn6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dSipGjYai9M1pZ8UkospaYNoJ3UlovfJJjRVjO/LvcU=; b=cY9O4jGjDX3LZE6CFZbilmJvdDTFK4tCF/ysug2iViBX88shwfYeBf45B9Ba+oqaMR wBNhfP3Gvk8MECN9g6SY/HTOvtWCmTcUyaPviqewH3xHCr1cBKKQOsLCYIfqwO08kOI9 NIoMZPdxXM8VL1rB5mF7L/dZZS3CowOQvvVDgqCq+O32GhkH/gjUPzNBKftS9R8Tt/sv LVd2V1WWhRvW99tcljJsar6PTyrnRavoVjCwxFQzndKx7Q2MsCE6ZakN/wX2OV1oEuvy Lg6Bs83rQhY2v7CAjzxfN5/RNJlritWw/480vLDe+Sj8U5Skl4q0ETKYLH49/5H5hdK/ S7OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VLhmXMYD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q125si2585132oib.7.2019.12.19.10.59.58; Thu, 19 Dec 2019 11:00:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VLhmXMYD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730231AbfLSS6r (ORCPT + 99 others); Thu, 19 Dec 2019 13:58:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:49796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730312AbfLSSyV (ORCPT ); Thu, 19 Dec 2019 13:54:21 -0500 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 A398B222C2; Thu, 19 Dec 2019 18:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781661; bh=8KfN9n0apjAZczFVWmMcdIxJcfcU/E5vQf1i1tp5uIU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VLhmXMYDLpJYxKMKd95D2Wl/L7rJbYEPk6E7rVT0esRA+CC1fITNYpoIkObQtogGm Uc9S9Fo4tzOCtzr/hxqLk30gYZJ3CQU9QSpCxw/niK54iwHxQKmWaTGCVaXQUQ9CAW VDhG5ZV9G2hVnjxN5CQdWxmVMVBbQnMmyQNFVzig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Long Li , Steve French Subject: [PATCH 5.4 28/80] cifs: smbd: Return -EAGAIN when transport is reconnecting Date: Thu, 19 Dec 2019 19:34:20 +0100 Message-Id: <20191219183103.389385952@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183031.278083125@linuxfoundation.org> References: <20191219183031.278083125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li commit 4357d45f50e58672e1d17648d792f27df01dfccd upstream. During reconnecting, the transport may have already been destroyed and is in the process being reconnected. In this case, return -EAGAIN to not fail and to retry this I/O. Signed-off-by: Long Li Cc: stable@vger.kernel.org Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/transport.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -319,8 +319,11 @@ __smb_send_rqst(struct TCP_Server_Info * int val = 1; __be32 rfc1002_marker; - if (cifs_rdma_enabled(server) && server->smbd_conn) { - rc = smbd_send(server, num_rqst, rqst); + if (cifs_rdma_enabled(server)) { + /* return -EAGAIN when connecting or reconnecting */ + rc = -EAGAIN; + if (server->smbd_conn) + rc = smbd_send(server, num_rqst, rqst); goto smbd_done; }