aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs3xdr.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2012-04-19 16:06:26 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2012-04-19 16:06:26 -0400
commiteac0556750e727ff39144a9a9e59d5ccf1fc0e2a (patch)
treef5ccff7795b2ad5e47f17fb475599c526f533e79 /fs/nfsd/nfs3xdr.c
parentf71fa31f9f7ac33cba12b8897983f950ad2c7a5b (diff)
parent19853301ef3289bda2d5264c1093e74efddaeab9 (diff)
Merge branch 'linus' into queue
Merge reason: development work has dependency on kvm patches merged upstream. Conflicts: Documentation/feature-removal-schedule.txt Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs3xdr.c')
-rw-r--r--fs/nfsd/nfs3xdr.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index 08c6e36ab2eb..43f46cd9edea 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -803,13 +803,13 @@ encode_entry_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name,
803 return p; 803 return p;
804} 804}
805 805
806static int 806static __be32
807compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, 807compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
808 const char *name, int namlen) 808 const char *name, int namlen)
809{ 809{
810 struct svc_export *exp; 810 struct svc_export *exp;
811 struct dentry *dparent, *dchild; 811 struct dentry *dparent, *dchild;
812 int rv = 0; 812 __be32 rv = nfserr_noent;
813 813
814 dparent = cd->fh.fh_dentry; 814 dparent = cd->fh.fh_dentry;
815 exp = cd->fh.fh_export; 815 exp = cd->fh.fh_export;
@@ -817,26 +817,20 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
817 if (isdotent(name, namlen)) { 817 if (isdotent(name, namlen)) {
818 if (namlen == 2) { 818 if (namlen == 2) {
819 dchild = dget_parent(dparent); 819 dchild = dget_parent(dparent);
820 if (dchild == dparent) { 820 /* filesystem root - cannot return filehandle for ".." */
821 /* filesystem root - cannot return filehandle for ".." */ 821 if (dchild == dparent)
822 dput(dchild); 822 goto out;
823 return -ENOENT;
824 }
825 } else 823 } else
826 dchild = dget(dparent); 824 dchild = dget(dparent);
827 } else 825 } else
828 dchild = lookup_one_len(name, dparent, namlen); 826 dchild = lookup_one_len(name, dparent, namlen);
829 if (IS_ERR(dchild)) 827 if (IS_ERR(dchild))
830 return -ENOENT; 828 return rv;
831 rv = -ENOENT;
832 if (d_mountpoint(dchild)) 829 if (d_mountpoint(dchild))
833 goto out; 830 goto out;
834 rv = fh_compose(fhp, exp, dchild, &cd->fh);
835 if (rv)
836 goto out;
837 if (!dchild->d_inode) 831 if (!dchild->d_inode)
838 goto out; 832 goto out;
839 rv = 0; 833 rv = fh_compose(fhp, exp, dchild, &cd->fh);
840out: 834out:
841 dput(dchild); 835 dput(dchild);
842 return rv; 836 return rv;
@@ -845,7 +839,7 @@ out:
845static __be32 *encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen) 839static __be32 *encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen)
846{ 840{
847 struct svc_fh fh; 841 struct svc_fh fh;
848 int err; 842 __be32 err;
849 843
850 fh_init(&fh, NFS3_FHSIZE); 844 fh_init(&fh, NFS3_FHSIZE);
851 err = compose_entry_fh(cd, &fh, name, namlen); 845 err = compose_entry_fh(cd, &fh, name, namlen);