Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753614AbbFDPOk (ORCPT ); Thu, 4 Jun 2015 11:14:40 -0400 Received: from nautica.notk.org ([91.121.71.147]:33418 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330AbbFDPOh (ORCPT ); Thu, 4 Jun 2015 11:14:37 -0400 X-Greylist: delayed 602 seconds by postgrey-1.27 at vger.kernel.org; Thu, 04 Jun 2015 11:14:37 EDT From: Dominique Martinet To: linux-nfs@vger.kernel.org, Anna Schumaker , Trond Myklebust Cc: linux-kernel@vger.kernel.org, Dominique Martinet , "Frank S. Filz" Subject: [PATCH] NFSv4: handle nfs4_get_referral failure Date: Thu, 4 Jun 2015 17:04:17 +0200 Message-Id: <1433430257-11894-1-git-send-email-dominique.martinet@cea.fr> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1318 Lines: 37 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 Signed-off-by: Frank S. Filz Signed-off-by: Dominique Martinet --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/