All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs-utils: NFSv4: fix backgrounding
@ 2009-11-05 15:31 Harshula Jayasuriya
       [not found] ` <1257435088.2984.66.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Harshula Jayasuriya @ 2009-11-05 15:31 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

Hi,

The nfsmount() function checks if !bg before running
switch(rpc_createerr.cf_stat). On the other hand, the nfs4mount()
function does not, and results in exiting the loop on the first
iteration even with the bg mount option.

NOTE: This and the previous patch ("nfs-utils: mount options can be lost
when using bg option") are relevant to non text-based mount options.

See https://bugzilla.redhat.com/show_bug.cgi?id=529370 for details.

Signed-off-by: Harshula Jayasuriya <harshula@redhat.com>
---
 utils/mount/nfs4mount.c |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/utils/mount/nfs4mount.c b/utils/mount/nfs4mount.c
index a2f318f..4a2fab7 100644
--- a/utils/mount/nfs4mount.c
+++ b/utils/mount/nfs4mount.c
@@ -217,8 +217,11 @@ int nfs4mount(const char *spec, const char *node, int flags,
 				progname);
 		goto fail;
 	}
-	snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
-		 old_opts, *old_opts ? "," : "", s);
+	if (running_bg)
+		strncpy(new_opts, old_opts, sizeof(new_opts));
+	else
+		snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
+			 old_opts, *old_opts ? "," : "", s);
 	*extra_opts = xstrdup(new_opts);
 
 	/* Set default options.
@@ -434,15 +437,17 @@ int nfs4mount(const char *spec, const char *node, int flags,
 			break;
 		}
 
-		switch(rpc_createerr.cf_stat){
-		case RPC_TIMEDOUT:
-			break;
-		case RPC_SYSTEMERROR:
-			if (errno == ETIMEDOUT)
+		if (!bg) {
+			switch(rpc_createerr.cf_stat) {
+			case RPC_TIMEDOUT:
 				break;
-		default:
-			rpc_mount_errors(hostname, 0, bg);
-			goto fail;
+			case RPC_SYSTEMERROR:
+				if (errno == ETIMEDOUT)
+					break;
+			default:
+				rpc_mount_errors(hostname, 0, bg);
+				goto fail;
+			}
 		}
 
 		if (bg && !running_bg) {
--

cya,
#


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfs-utils: NFSv4: fix backgrounding
       [not found] ` <1257435088.2984.66.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2009-11-16 18:43   ` Steve Dickson
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2009-11-16 18:43 UTC (permalink / raw)
  To: Harshula Jayasuriya; +Cc: linux-nfs



On 11/05/2009 10:31 AM, Harshula Jayasuriya wrote:
> Hi,
> 
> The nfsmount() function checks if !bg before running
> switch(rpc_createerr.cf_stat). On the other hand, the nfs4mount()
> function does not, and results in exiting the loop on the first
> iteration even with the bg mount option.
> 
> NOTE: This and the previous patch ("nfs-utils: mount options can be lost
> when using bg option") are relevant to non text-based mount options.
> 
> See https://bugzilla.redhat.com/show_bug.cgi?id=529370 for details.
> 
> Signed-off-by: Harshula Jayasuriya <harshula@redhat.com>
Committed...

steved.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-16 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-05 15:31 [PATCH] nfs-utils: NFSv4: fix backgrounding Harshula Jayasuriya
     [not found] ` <1257435088.2984.66.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-11-16 18:43   ` Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.