lkml.org 
[lkml]   [1997]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectpatch for nfsd
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--- 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
\
 
 \ /
  Last update: 2005-03-22 13:40    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site