From patchwork Fri Dec 2 01:09:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9457573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2D59C60235 for ; Fri, 2 Dec 2016 01:10:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2008D284E3 for ; Fri, 2 Dec 2016 01:10:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14E9328518; Fri, 2 Dec 2016 01:10:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97885284E3 for ; Fri, 2 Dec 2016 01:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824AbcLBBKM (ORCPT ); Thu, 1 Dec 2016 20:10:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:45362 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbcLBBKM (ORCPT ); Thu, 1 Dec 2016 20:10:12 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D2849AB03; Fri, 2 Dec 2016 01:10:10 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Fri, 02 Dec 2016 12:09:43 +1100 Subject: [PATCH 1/4] mount: don't hide temporary error code on timeout. Cc: linux-nfs@vger.kernel.org Message-ID: <148064098372.9179.7884661059252581625.stgit@noble> In-Reply-To: <148064084082.9179.6570593128436337540.stgit@noble> References: <148064084082.9179.6570593128436337540.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a mount attempt times out due to repeated non-permanent errors, we always report ETIMEDOUT rather than the actual error. Errors like "ECONNREFUSED" or "EHOSTUNREACH" or "ESTALE" might be more useful than the generic "ETIMEDOUT". So preserve the error code. Signed-off-by: NeilBrown --- utils/mount/stropts.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index d5dfb5e4a669..7b1ad93effc0 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -990,10 +990,8 @@ static int nfsmount_fg(struct nfsmount_info *mi) if (nfs_is_permanent_error(errno)) break; - if (time(NULL) > timeout) { - errno = ETIMEDOUT; + if (time(NULL) > timeout) break; - } if (errno != ETIMEDOUT) { if (sleep(secs))