knfsd semaphore problem

Bill Hawes (whawes@transmeta.com)
Wed, 26 Aug 1998 13:02:36 -0700


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

Hi Steve,

I've attached a small diagnostic patch to look for the nfsd "semaphore in use"
problem. If you (and anyone else who has seen these messages) could give
this a try, hopefully we can get it fixed right away.

The patch is compiled but not tested ...

Regards,
Bill

--------------D0C6E8842C27BBB25ECF5217
Content-Type: text/plain; charset=us-ascii; name="nfsd_117-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="nfsd_117-patch"

--- linux-2.1.117/include/linux/nfsd/nfsfh.h.old Sun Aug 23 14:29:15 1998
+++ linux-2.1.117/include/linux/nfsd/nfsfh.h Tue Aug 25 18:27:04 1998
@@ -133,18 +133,24 @@
static inline void
fh_lock(struct svc_fh *fhp)
{
- struct inode *inode = fhp->fh_dentry->d_inode;
+ struct inode *inode;

/*
dfprintk(FILEOP, "nfsd: fh_lock(%x/%ld) locked = %d\n",
SVCFH_DEV(fhp), SVCFH_INO(fhp), fhp->fh_locked);
*/
+ if (!fhp->fh_dverified) {
+ printk(KERN_ERR "fh_lock: fh not verified!\n");
+ return;
+ }
if (fhp->fh_locked) {
printk(KERN_WARNING "fh_lock: %s/%s already locked!\n",
fhp->fh_dentry->d_parent->d_name.name,
fhp->fh_dentry->d_name.name);
return;
}
+
+ inode = fhp->fh_dentry->d_inode;
down(&inode->i_sem);
if (!fhp->fh_pre_mtime)
fhp->fh_pre_mtime = inode->i_mtime;
@@ -157,12 +163,21 @@
static inline void
fh_unlock(struct svc_fh *fhp)
{
+ if (!fhp->fh_dverified)
+ printk(KERN_ERR "fh_unlock: fh not verified!\n");
+
if (fhp->fh_locked) {
- struct inode *inode = fhp->fh_dentry->d_inode;
+ struct dentry *dentry = fhp->fh_dentry;
+ struct inode *inode = dentry->d_inode;
+
if (!fhp->fh_post_version)
fhp->fh_post_version = inode->i_version;
fhp->fh_locked = 0;
up(&inode->i_sem);
+ if (atomic_read(&inode->i_sem.count) > 1)
+ printk(KERN_ERR "fh_unlock: %s/%s has bad count %d\n",
+ dentry->d_parent->d_name.name, dentry->d_name.name,
+ atomic_read(&inode->i_sem.count));
}
}

--- linux-2.1.117/fs/nfsd/nfsfh.c.old Thu Aug 6 16:54:09 1998
+++ linux-2.1.117/fs/nfsd/nfsfh.c Tue Aug 25 18:17:19 1998
@@ -1115,7 +1115,12 @@
* may not be done on error paths, but the cleanup must call fh_put.
* Fix this soon!
*/
+ if (fhp->fh_dverified) {
+ printk(KERN_ERR "fh_compose: fh %s/%s already verified??\n",
+ dentry->d_parent->d_name.name, dentry->d_name.name);
+ }
fh_init(fhp);
+
fhp->fh_handle.fh_dcookie = dentry;
if (inode) {
fhp->fh_handle.fh_ino = ino_t_to_u32(inode->i_ino);

--------------D0C6E8842C27BBB25ECF5217--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html