Thread (6 messages) 6 messages, 5 authors, 2011-05-02

Re: [PATCH] mmotm: fix hang at startup

From: Wu Fengguang <hidden>
Date: 2011-05-01 03:25:07
Also in: linux-fsdevel, lkml

On Sun, May 01, 2011 at 10:35:38AM +0800, Hugh Dickins wrote:
Yesterday's mmotm hangs at startup, and with lockdep it reports:
BUG: spinlock recursion on CPU#1, blkid/284 - with bdi_lock_two()
called from bdev_inode_switch_bdi() in the backtrace.  It appears
that this function is sometimes called with new the same as old.

Signed-off-by: Hugh Dickins <hughd@google.com>
Thanks!

Reviewed-by: Wu Fengguang <redacted>
quoted hunk ↗ jump to hunk
Fix to
writeback-split-inode_wb_list_lock-into-bdi_writebacklist_lock.patch

 fs/block_dev.c |    2 ++
 1 file changed, 2 insertions(+)
--- 2.6.39-rc5-mm1/fs/block_dev.c	2011-04-29 18:20:09.183314733 -0700
+++ linux/fs/block_dev.c	2011-04-30 17:55:45.718785263 -0700
@@ -57,6 +57,8 @@ static void bdev_inode_switch_bdi(struct
 {
 	struct backing_dev_info *old = inode->i_data.backing_dev_info;
 
+	if (dst == old)
+		return;
nitpick: it could help to add a comment

        /* avoid spinlock recursion */

to indicate that's not merely an optional optimization, but indeed
required for correctness.

Thanks,
Fengguang
 	bdi_lock_two(&old->wb, &dst->wb);
 	spin_lock(&inode->i_lock);
 	inode->i_data.backing_dev_info = dst;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help