All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <dominique.martinet@cea.fr>
To: linux-nfs@vger.kernel.org,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Trond Myklebust <trond.myklebust@primarydata.com>
Cc: linux-kernel@vger.kernel.org,
	Dominique Martinet <dominique.martinet@cea.fr>,
	"Frank S. Filz" <ffilzlnx@mindspring.com>
Subject: [PATCH] NFSv4: handle nfs4_get_referral failure
Date: Thu,  4 Jun 2015 17:04:17 +0200	[thread overview]
Message-ID: <1433430257-11894-1-git-send-email-dominique.martinet@cea.fr> (raw)

nfs4_proc_lookup_common is supposed to return a posix error, we have to
handle any error returned that isn't errno

Reported-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Frank S. Filz <ffilzlnx@mindspring.com>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
---

Other way of fixing it would be to return something like -EIO directly
in nfs4_get_referral, but I believe handling exception is the right
thing to do.
Only other return code atm is -ENOMEM which probably isn't recoverable?

 fs/nfs/nfs4proc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 627f37c..e7fbf24 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3356,6 +3356,8 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
 			goto out;
 		case -NFS4ERR_MOVED:
 			err = nfs4_get_referral(client, dir, name, fattr, fhandle);
+			if (err == -NFS4ERR_MOVED)
+				err = nfs4_handle_exception(NFS_SERVER(dir), err, &exception);
 			goto out;
 		case -NFS4ERR_WRONGSEC:
 			err = -EPERM;
-- 
2.4.2


             reply	other threads:[~2015-06-04 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 15:04 Dominique Martinet [this message]
2015-06-04 15:13 ` [PATCH] NFSv4: handle nfs4_get_referral failure Frank Filz

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=1433430257-11894-1-git-send-email-dominique.martinet@cea.fr \
    --to=dominique.martinet@cea.fr \
    --cc=anna.schumaker@netapp.com \
    --cc=ffilzlnx@mindspring.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /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 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.