From patchwork Mon Jul 14 09:01:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4543571 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 330BC9F1D6 for ; Mon, 14 Jul 2014 09:01:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FF092011E for ; Mon, 14 Jul 2014 09:01:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E47D32012B for ; Mon, 14 Jul 2014 09:01:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385AbaGNJB2 (ORCPT ); Mon, 14 Jul 2014 05:01:28 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:55566 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbaGNJB1 (ORCPT ); Mon, 14 Jul 2014 05:01:27 -0400 Received: by mail-la0-f51.google.com with SMTP id el20so45750lab.10 for ; Mon, 14 Jul 2014 02:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=FZCJp3rfH5CRFpHwiyYvES+u4YIlbdlq+uU4gepmSCw=; b=FLRZ70EkgY6fZdcK7dKvjinD4bDAJxbinwtyrGSCR+pupwnb9K24M6yzNyRagEwN9M Xm7fTRdBcN+vu0jedi6AvFe2zu/ORkCy7qlEnwhh2gyE6v8t6s4yGHkNQqZ1YDjEHzEL bUS720aoFZwdpnAwTSfRSdC7FXB2qdvUQu+rVerbb8CvJOlPWW0VO/LvdM04xKJwjMQI 7MJw6EukT/HuGnmYY2hwhkd9vX0G1B8uMEe44YSldUWEqEahlaAftisIHjrGGOu05HdU yeDrImL+T7j6w7oNdTBbAfvDnEXnin5cEsvOX+3P0pGBFs/zhH2KGfU3lR6l5sUm6CnG pX0Q== X-Received: by 10.152.29.38 with SMTP id g6mr1476687lah.54.1405328486279; Mon, 14 Jul 2014 02:01:26 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.85]) by mx.google.com with ESMTPSA id r2sm5063434lag.27.2014.07.14.02.01.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 02:01:25 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH v2 1/7] CIFS: Indicate reconnect with ECONNABORTED error code Date: Mon, 14 Jul 2014 13:01:11 +0400 Message-Id: <1405328477-13484-2-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1405328477-13484-1-git-send-email-pshilovsky@samba.org> References: <1405328477-13484-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP that let us not mix it with EAGAIN. Signed-off-by: Pavel Shilovsky --- fs/cifs/connect.c | 8 ++++---- fs/cifs/file.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 20d75b8..b0427f6 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -557,7 +557,7 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct kvec *iov_orig, try_to_freeze(); if (server_unresponsive(server)) { - total_read = -EAGAIN; + total_read = -ECONNABORTED; break; } @@ -571,7 +571,7 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct kvec *iov_orig, break; } else if (server->tcpStatus == CifsNeedReconnect) { cifs_reconnect(server); - total_read = -EAGAIN; + total_read = -ECONNABORTED; break; } else if (length == -ERESTARTSYS || length == -EAGAIN || @@ -588,7 +588,7 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct kvec *iov_orig, cifs_dbg(FYI, "Received no data or error: expecting %d\n" "got %d", to_read, length); cifs_reconnect(server); - total_read = -EAGAIN; + total_read = -ECONNABORTED; break; } } @@ -786,7 +786,7 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid) cifs_dbg(VFS, "SMB response too long (%u bytes)\n", pdu_length); cifs_reconnect(server); wake_up(&server->response_q); - return -EAGAIN; + return -ECONNABORTED; } /* switch to large buffer if too big for a small one */ diff --git a/fs/cifs/file.c b/fs/cifs/file.c index d5f66ba..0974dd2 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2908,7 +2908,7 @@ cifs_uncached_read_into_pages(struct TCP_Server_Info *server, total_read += result; } - return total_read > 0 && result != -EAGAIN ? total_read : result; + return total_read > 0 && result != -ECONNABORTED ? total_read : result; } static int @@ -3358,7 +3358,7 @@ cifs_readpages_read_into_pages(struct TCP_Server_Info *server, total_read += result; } - return total_read > 0 && result != -EAGAIN ? total_read : result; + return total_read > 0 && result != -ECONNABORTED ? total_read : result; } static int