public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFSv4: handle nfs4_get_referral failure
@ 2015-06-04 15:04 Dominique Martinet
  2015-06-04 15:13 ` Frank Filz
  0 siblings, 1 reply; 2+ messages in thread
From: Dominique Martinet @ 2015-06-04 15:04 UTC (permalink / raw)
  To: linux-nfs, Anna Schumaker, Trond Myklebust
  Cc: linux-kernel, Dominique Martinet, Frank S. Filz

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


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

end of thread, other threads:[~2015-06-04 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-04 15:04 [PATCH] NFSv4: handle nfs4_get_referral failure Dominique Martinet
2015-06-04 15:13 ` Frank Filz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox