X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fnfsd%2Fnfs3xdr.c;h=1e3af06b7a8ef84ac8bb8d9c374a4eb18b42b851;hb=8924cb29b44d7e7bc69a58f6d196470a5bcd9385;hp=8291752c726a0ce23fb86a816ab6a49e1c86f4b7;hpb=86090fcac5e27b630656fe3d963a6b80e26dac44;p=linux-2.6.git diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 8291752c7..1e3af06b7 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c @@ -799,6 +799,7 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, { struct svc_export *exp; struct dentry *dparent, *dchild; + int rv = 0; dparent = cd->fh.fh_dentry; exp = cd->fh.fh_export; @@ -813,11 +814,12 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp, dchild = lookup_one_len(name, dparent, namlen); if (IS_ERR(dchild)) return 1; - if (d_mountpoint(dchild)) - return 1; - if (fh_compose(fhp, exp, dchild, &cd->fh) != 0 || !dchild->d_inode) - return 1; - return 0; + if (d_mountpoint(dchild) || + fh_compose(fhp, exp, dchild, &cd->fh) != 0 || + !dchild->d_inode) + rv = 1; + dput(dchild); + return rv; } /* @@ -934,7 +936,7 @@ encode_entry(struct readdir_cd *ccd, const char *name, memmove(tmp, (caddr_t)tmp+len1, len2); /* update offset */ - if (((cd->offset - tmp) << 2) <= len1) + if (((cd->offset - tmp) << 2) < len1) cd->offset = p + (cd->offset - tmp); else cd->offset -= len1 >> 2;