--- linux-2.2.14/fs/nfsd/nfsfh.c.cookie Wed Mar  8 14:36:22 2000
+++ linux-2.2.14/fs/nfsd/nfsfh.c        Fri Mar 10 11:00:09 2000
@@ -1159,6 +1159,18 @@ fh_verify(struct svc_rqst *rqstp, struct
       error = nfserr_noent;
       dentry = find_fh_dentry(fh);
       if (!dentry) {
+               /* Usually inode number 0 shouldn't appear in any
+                  filehandle. We want to know who has it. */
+               if (!fh->fh_ino || !fh->fh_dirino)
+                       printk("fh_verify: not found %s: exp %s/%u file (%s/%u dir %u) coookie 0x%lx, generation 0x%x\n",
+                               rqstp->rq_client->cl_ident,
+                               kdevname(fh->fh_xdev),
+                               fh->fh_xino,
+                               kdevname(fh->fh_dev),
+                               fh->fh_ino,
+                               fh->fh_dirino,
+                               (long) fh->fh_dcookie,
+                               fh->fh_generation);
               goto out;
       }
       if (IS_ERR(dentry)) {
@@ -1196,8 +1208,8 @@ check_type:
          filehandle to the client. We use fh->fh_dcookie to indicate
          if fh->fh_generation is set or not. If fh->fh_dcookie is
          not set, don't return stale filehandle. */
-       if (inode->i_generation != fh->fh_generation) {
-               if (fh->fh_dcookie) {
+       if (fh->fh_dcookie) {
+               if (inode->i_generation != fh->fh_generation) {
                       dprintk("fh_verify: Bad version %lu %u %u: 0x%x, 0x%x\n",
                               inode->i_ino,
                               inode->i_generation,
@@ -1206,14 +1218,14 @@ check_type:
                       nfsdstats.fh_stale++;
                       goto out;
               }
-               else {
-                       /* We get here when inode is fetched by other
-                          threads. We just use what is in there. */
-                       fh->fh_ino = ino_t_to_u32(inode->i_ino);
-                       fh->fh_generation = inode->i_generation;
-                       fh->fh_dcookie = (struct dentry *)0xfeebbaca;
-                       nfsdstats.fh_concurrent++;
-               }
+       }
+       else {
+               /* We get here when inode is fetched by other
+                  threads. We just use what is in there. */
+               fh->fh_ino = ino_t_to_u32(inode->i_ino);
+               fh->fh_generation = inode->i_generation;
+               fh->fh_dcookie = (struct dentry *)0xfeebbaca;
+               nfsdstats.fh_concurrent++;
       }
       exp = fhp->fh_export;
       if (type > 0 && (inode->i_mode & S_IFMT) != type) {
@@ -1306,7 +1318,6 @@ fh_compose(struct svc_fh *fhp, struct sv
       }
       fh_init(fhp);

-       fhp->fh_handle.fh_dcookie = dentry;
       if (inode) {
               fhp->fh_handle.fh_ino = ino_t_to_u32(inode->i_ino);
               fhp->fh_handle.fh_generation = inode->i_generation;