patch for nfsd

Bill Hawes (whawes@star.net)
Sun, 17 Aug 1997 10:26:57 -0400


This is a multi-part message in MIME format.
--------------B782182D6868D36195F688CD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've attached a patch to fix a couple of dentry-related problems in
nfsd.

(1) In export.c, a lookup failure could lead to an attempt to dput an
error code, so I've added a !IS_ERR test to the exit cleanup.

(2) in fh_put, the code tests the verified flag before dputting the
dentry, but doesn't clear the flag or NULL out the dentry field. This
could possibly lead to a bad dput or using a stale dentry pointer.

Regards,
Bill
--------------B782182D6868D36195F688CD
Content-Type: text/plain; charset=us-ascii; name="nfsd_50-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="nfsd_50-patch"

--- linux-2.1.50/fs/nfsd/export.c.old Tue Aug 12 07:49:18 1997
+++ linux-2.1.50/fs/nfsd/export.c Sun Aug 17 09:25:13 1997
@@ -248,7 +248,7 @@

finish:
/* Release dentry */
- if (err < 0 && dentry)
+ if (err < 0 && !IS_ERR(dentry))
dput(dentry);

/* Unlock hashtable */
--- linux-2.1.50/include/linux/nfsd/nfsfh.h.old Thu Aug 14 18:59:46 1997
+++ linux-2.1.50/include/linux/nfsd/nfsfh.h Sun Aug 17 09:34:53 1997
@@ -137,6 +137,7 @@
if (fhp->fh_dverified) {
fh_unlock(fhp);
dput(fhp->fh_handle.fh_dentry);
+ fhp->fh_dverified = 0;
}
}
#else
@@ -159,6 +160,7 @@
} else {
fh_unlock(fhp);
dput(dentry);
+ fhp->fh_dverified = 0;
}
}
#endif

--------------B782182D6868D36195F688CD--