From patchwork Fri Mar 7 15:04:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 3792151 Return-Path: X-Original-To: patchwork-linux-nfs@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 765CE9F35F for ; Fri, 7 Mar 2014 15:04:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A260620295 for ; Fri, 7 Mar 2014 15:04:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9EC820274 for ; Fri, 7 Mar 2014 15:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752046AbaCGPEq (ORCPT ); Fri, 7 Mar 2014 10:04:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19382 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbaCGPEq (ORCPT ); Fri, 7 Mar 2014 10:04:46 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s27F4kEf028620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 7 Mar 2014 10:04:46 -0500 Received: from smallhat.boston.devel.redhat.com (vpn-54-164.rdu2.redhat.com [10.10.54.164]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s27F4j6e030724 for ; Fri, 7 Mar 2014 10:04:45 -0500 From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH] mount.nfs: Ensure parent mount of background mounts timeout Date: Fri, 7 Mar 2014 10:04:44 -0500 Message-Id: <1394204684-1283-1-git-send-email-steved@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 With a proposed kernel fixed, the parent mounts of background mounts do not time out for over 5 mins. This patch will append "retrans=1,timeo=100" to the mount options (when they don't exist) causing the parent mount to time out in ~25secs The options are then removed (if they were added) before the child mount, in background, is done Signed-off-by: Steve Dickson --- utils/mount/stropts.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index a642394..417d022 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -921,6 +921,14 @@ static int nfsmount_fg(struct nfsmount_info *mi) */ static int nfsmount_parent(struct nfsmount_info *mi) { + po_return_t retrans, timeo; + + if (po_contains(mi->options, "retrans") == PO_NOT_FOUND) + retrans = po_append(mi->options, "retrans=1"); + + if (po_contains(mi->options, "timeo") == PO_NOT_FOUND) + timeo = po_append(mi->options, "timeo=100"); /* ~25 secs */ + if (nfs_try_mount(mi)) return EX_SUCCESS; @@ -929,6 +937,10 @@ static int nfsmount_parent(struct nfsmount_info *mi) mount_error(mi->spec, mi->node, errno); return EX_FAIL; } + if (retrans == PO_SUCCEEDED) + po_remove_all(mi->options, "retrans"); + if (timeo == PO_SUCCEEDED) + po_remove_all(mi->options, "timeo"); sys_mount_errors(mi->hostname, errno, 1, 1); return EX_BG;