Re: linux-2.0.32 + ben-inode.diff hangs on NFS

Benjamin C.R. LaHaise (blah@kvack.org)
Sun, 9 Nov 1997 14:56:31 -0500 (EST)


On 9 Nov 1997, Miquel van Smoorenburg wrote:

> In article <644all$73g$1@defiant.cistron.nl>,
> Miquel van Smoorenburg <miquels@cistron.nl> wrote:
> >I'm running linux-2.0.32-1 + the ben-inode.diff on one of our machines.
> >Some processes start to hang in state `D' on NFS access.
> >
> [..]
> >Seems they are stuck in wait_on_inode. So this is probably a bug in the
> >ben-inode.diff...

Ok, found it - nfs_put_inode in doing the sillyrename cleanup ends up
doing an iget on the inode. The patch below 'll fix it.

> It just got worse - I tried to revert to a "plain" 2.0.32-1, so compiled
> one (on another machine), installed it but even lilo now hangs in state D.
> Tried "sync" .. also hangs. Oops - hard reboot required I'm afraid. We'll
> see what happens with 2.0.32-1 vanilla.

Was this with a process already in state D? If so that should explain it
- sync'ing also does a wait_on_inode. Otherwise, I'm curious...

-ben

diff -ur 2.0.32-1/fs/nfs/dir.c lin-ben/fs/nfs/dir.c
--- 2.0.32-1/fs/nfs/dir.c Tue Apr 8 11:47:46 1997
+++ lin-ben/fs/nfs/dir.c Sun Nov 9 14:21:16 1997
@@ -551,11 +551,13 @@
int error, slen;

slen = sprintf(silly, ".nfs%ld", inode->i_ino);
- if ((error = nfs_unlink(dir, silly, slen)) < 0) {
+ error = nfs_proc_remove(NFS_SERVER(dir), NFS_FH(dir), silly);
+ nfs_lookup_cache_remove(dir, NULL, silly);
+ if (error < 0)
printk("NFS silly_rename cleanup failed (err = %d)\n",
-error);
- }
NFS_RENAMED_DIR(inode) = NULL;
+ iput(dir);
}

static int nfs_unlink(struct inode *dir, const char *name, int len)