This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / nfsd / nfs3xdr.c
index 8291752..1e3af06 100644 (file)
@@ -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;