From patchwork Wed Nov 30 00:53:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9453333 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 750F960235 for ; Wed, 30 Nov 2016 00:55:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67B4C285A8 for ; Wed, 30 Nov 2016 00:55:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AFF3285BB; Wed, 30 Nov 2016 00:55:27 +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 70946285A8 for ; Wed, 30 Nov 2016 00:55:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754924AbcK3AzZ (ORCPT ); Tue, 29 Nov 2016 19:55:25 -0500 Received: from mx2.suse.de ([195.135.220.15]:56741 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755177AbcK3AzY (ORCPT ); Tue, 29 Nov 2016 19:55:24 -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 528F0ACA3; Wed, 30 Nov 2016 00:54:42 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Wed, 30 Nov 2016 11:53:52 +1100 Subject: [PATCH 1/2] mount: don't hide temporary error code on timeout. Cc: Linux NFS Mailing List Message-ID: <148046723196.21092.14059956601089626164.stgit@noble> In-Reply-To: <148046718451.21092.10685567606499960786.stgit@noble> References: <148046718451.21092.10685567606499960786.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))