Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Cc: Fedora Kernel Mailing list <fedora-kernel-list@redhat.com>
Subject: [PATCH] NFS Client mounts hang when exported directory do not exist
Date: Fri, 11 Apr 2008 20:03:06 -0400	[thread overview]
Message-ID: <47FFFC3A.2040708@RedHat.com> (raw)

This patch fixes a regression that was introduced by the string based mounts. 

nfs_mount() statically returns -EACCES for every error returned
by the remote mounted. This is incorrect because -EACCES is
an non-fatal error to the mount.nfs command. This error causes
mount.nfs to retry the mount even in the case when the exported
directory does not exist. 

This patch maps the errors returned by the remote mountd into
valid errno values, exactly how it was done pre-string based 
mounts. By returning the correct errno enables mount.nfs 
to do the right thing.  

Signed-off-by: Steve Dickson <steved@redhat.com>
---
Take 2- Why reinvent the wheel, as Trond pointed out using
nfs_stat_to_errno() makes more sense and is makes things much 
similar, something I'm always a fan of... 

diff -up linux/fs/nfs/mount_clnt.c.orig linux/fs/nfs/mount_clnt.c
--- linux/fs/nfs/mount_clnt.c.orig	2008-04-09 08:32:43.000000000 -0400
+++ linux/fs/nfs/mount_clnt.c	2008-04-11 19:42:16.000000000 -0400
@@ -14,6 +14,7 @@
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/sched.h>
 #include <linux/nfs_fs.h>
+#include "internal.h"
 
 #ifdef RPC_DEBUG
 # define NFSDBG_FACILITY	NFSDBG_MOUNT
@@ -98,7 +99,7 @@ out_call_err:
 
 out_mnt_err:
 	dprintk("NFS: MNT server returned result %d\n", result.status);
-	status = -EACCES;
+	status = -nfs_stat_to_errno(result.status);
 	goto out;
 }

             reply	other threads:[~2008-04-12  0:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12  0:03 Steve Dickson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-04-11 16:05 [PATCH] NFS Client mounts hang when exported directory do not exist Steve Dickson
2008-04-11 15:12 Steve Dickson
     [not found] ` <47FF7FCC.2050403-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2008-04-11 15:20   ` Eric Paris
     [not found]     ` <1207927210.3379.1.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-04-11 16:10       ` Steve Dickson
     [not found]         ` <47FF8D6A.9040902-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2008-04-11 18:35           ` Eric Paris
     [not found]             ` <1207938902.3379.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-04-12  0:14               ` Steve Dickson
2008-04-11 16:22   ` Chuck Lever
2008-04-11 16:37     ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FFFC3A.2040708@RedHat.com \
    --to=steved@redhat.com \
    --cc=fedora-kernel-list@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox