From 16df68d1ad09e6d378fe3d44de5e43e3429a3a10 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 26 Feb 2004 06:47:53 -0800 Subject: [PATCH] [PATCH] kNFSd: Fix for lookup-parent at pseudo root From: NeilBrown tests if current_fh is the pseudo root for the client and returns nfserr_noent if so. need to call exp_pseudoroot because different clients can have --- fs/nfsd/nfs4proc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 39ee88b7fda56..078529195e854 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -349,14 +349,18 @@ nfsd4_link(struct svc_rqst *rqstp, struct svc_fh *current_fh, static inline int nfsd4_lookupp(struct svc_rqst *rqstp, struct svc_fh *current_fh) { - /* - * XXX: We currently violate the spec in one small respect - * here. If LOOKUPP is done at the root of the pseudofs, - * the spec requires us to return NFSERR_NOENT. Personally, - * I think that leaving the filehandle unchanged is more - * logical, but this is an academic question anyway, since - * no clients actually use LOOKUPP. - */ + struct svc_fh tmp_fh; + int ret; + + fh_init(&tmp_fh, NFS4_FHSIZE); + if((ret = exp_pseudoroot(rqstp->rq_client, &tmp_fh, + &rqstp->rq_chandle)) != 0) + return ret; + if (tmp_fh.fh_dentry == current_fh->fh_dentry) { + fh_put(&tmp_fh); + return nfserr_noent; + } + fh_put(&tmp_fh); return nfsd_lookup(rqstp, current_fh, "..", 2, current_fh); } -- 2.53.0