]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NFS: Fix a regression in the referral code
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 7 Nov 2011 20:50:32 +0000 (15:50 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 7 Nov 2011 21:20:00 +0000 (16:20 -0500)
Fix a regression that was introduced by commit
0c2e53f11a6dae9e3af5f50f5ad0382e7c3e0cfa (NFS: Remove the unused
"lookupfh()" version of nfs4_proc_lookup()).

In the case where the lookup gets an NFS4ERR_MOVED, we want to return
the result of nfs4_get_referral(). Instead, that value is getting
clobbered by the call to nfs4_handle_exception()...

Reported-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Tested-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c

index 069cb8094d43c7b7f048c67dec0db041f84a4917..be2bbac13817c7ec624363afb4caf8bdd65a72b4 100644 (file)
@@ -2464,8 +2464,7 @@ static int nfs4_proc_lookup(struct rpc_clnt *clnt, struct inode *dir, struct qst
                case -NFS4ERR_BADNAME:
                        return -ENOENT;
                case -NFS4ERR_MOVED:
-                       err = nfs4_get_referral(dir, name, fattr, fhandle);
-                       break;
+                       return nfs4_get_referral(dir, name, fattr, fhandle);
                case -NFS4ERR_WRONGSEC:
                        nfs_fixup_secinfo_attributes(fattr, fhandle);
                }