Re: 2.0.31-1 patch: possible fix for some inode problems

Nathan Bryant (nathan@nbryan71.dorm.usm.maine.edu)
Sun, 9 Nov 1997 22:57:40 -0500 (EST)


On Sun, 9 Nov 1997, Benjamin C.R. LaHaise wrote:

> Hmmmm... I'd like to know where clear_inode is getting called from like
> this (as reading through source looks like it ain't gonna happen), so if
> you could change the printk in clear_inode to something like:
>
> printk(KERN_DEBUG "VFS: clear_inode on unlocked from %p\n", (&inode)[-1]);
>
> And report what function the address maps to, I'd appreciate it. Thanks!

Okay, I think this should fix it. get_empty_inode() appears to be locking
the wrong inode.

--- linux/fs/inode.c.orig Sun Nov 9 22:41:42 1997
+++ linux/fs/inode.c Sun Nov 9 22:51:36 1997
@@ -550,9 +550,9 @@
if (best->i_count)
goto repeat;
found_good:
- lock_inode(inode);
+ lock_inode(best);
clear_inode(best);
- unlock_inode(inode);
+ unlock_inode(best);
best->i_count = 1;
best->i_nlink = 1;
best->i_version = ++event;

Nathan Bryant
nathan@nbryan71.dorm.usm.maine.edu
nbryan71@mail.caps.maine.edu