lkml.org 
[lkml]   [1998]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectknfsd semaphore problem
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

--- 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);
\
 
 \ /
  Last update: 2005-03-22 13:44    [from the cache]
©2003-2011 Jasper Spaans