]> bbs.cooldavid.org Git - net-next-2.6.git/commit - fs/inode.c
[PATCH] __wait_on_freeing_inode fix
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 12 Jul 2005 20:58:10 +0000 (13:58 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 12 Jul 2005 23:00:59 +0000 (16:00 -0700)
commit168a9fd6a1bf91041adf9909f6c72cf747f0ca8c
tree65b4dc843f34f0837b10f4fbbc1763f5aae87b7b
parent3b6bfcdb116f2cc2cab921fcac6d39d4022952d2
[PATCH] __wait_on_freeing_inode fix

This patch fixes queer behavior in __wait_on_freeing_inode().

If I_LOCK was not set it called yield(), effectively busy waiting for the
removal of the inode from the hash.  This change was introduced within
"[PATCH] eliminate inode waitqueue hashtable" Changeset 1.1938.166.16 last
october by wli.

The solution is to restore the old behavior, of unconditionally waiting on
the waitqueue.  It doesn't matter if I_LOCK is not set initally, the task
will go to sleep, and wake up when wake_up_inode() is called from
generic_delete_inode() after removing the inode from the hash chain.

Comment is also updated to better reflect current behavior.

This condition is very hard to trigger normally (simultaneous clear_inode()
with iget()) so probably only heavy stress testing can reveal any change of
behavior.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/inode.c