linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mount.nfs: Ensure parent mount of background mounts timeout
@ 2014-03-07 15:04 Steve Dickson
  0 siblings, 0 replies; only message in thread
From: Steve Dickson @ 2014-03-07 15:04 UTC (permalink / raw)
  To: Linux NFS Mailing list

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 <steved@redhat.com>
---
 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;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-07 15:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07 15:04 [PATCH] mount.nfs: Ensure parent mount of background mounts timeout Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).