From patchwork Thu Jul 10 09:30:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4522381 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 917D39F26C for ; Thu, 10 Jul 2014 09:31:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD6732021B for ; Thu, 10 Jul 2014 09:31:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5A6720200 for ; Thu, 10 Jul 2014 09:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbaGJJa7 (ORCPT ); Thu, 10 Jul 2014 05:30:59 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:38907 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752449AbaGJJa6 (ORCPT ); Thu, 10 Jul 2014 05:30:58 -0400 Received: by mail-la0-f49.google.com with SMTP id gf5so5754372lab.8 for ; Thu, 10 Jul 2014 02:30:56 -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=yQMUZIcXiRBtUdp8BCOKo1TevrxfFbjqPifMYYlU64k4qxPBV2zcc/ZN9/jFzCMk0v aVK5AzfknJd9Mvi4XufYI5nVqoOHI2k2sTYKfTZxZN/LhlM+EyqA8PQ6naSfW86pnpLP jzoSVH/MPVvzmOm6EauO/DUJO+k/E/dSaqcMo6MQRKmhTmOr6LqrYdFJ4aMxQ0EbWrbz 0QraIDNmruxxIjrUCDe5799ryhOaUN9+oX2WZqoXb9QN82YYNNokQBOMpRB4ov3AQXot UCNxGCEkUXLL0E9fqaRx26mFnEbW8Pe1TE2RT90FWmlYrsGI9HUu6mbvfHxiBqhVu8Le 747Q== X-Received: by 10.112.202.39 with SMTP id kf7mr3433377lbc.37.1404984656686; Thu, 10 Jul 2014 02:30:56 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.36]) by mx.google.com with ESMTPSA id v6sm23257226lal.35.2014.07.10.02.30.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jul 2014 02:30:55 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 1/7] CIFS: Indicate reconnect with ECONNABORTED error code Date: Thu, 10 Jul 2014 13:30:41 +0400 Message-Id: <1404984647-8710-2-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1404984647-8710-1-git-send-email-pshilovsky@samba.org> References: <1404984647-8710-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=-7.4 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