Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753152Ab1EADZN (ORCPT ); Sat, 30 Apr 2011 23:25:13 -0400 Received: from mga11.intel.com ([192.55.52.93]:61548 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107Ab1EADZK (ORCPT ); Sat, 30 Apr 2011 23:25:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.64,296,1301900400"; d="scan'208";a="686573595" Date: Sun, 1 May 2011 11:25:07 +0800 From: Wu Fengguang To: Hugh Dickins Cc: Andrew Morton , Christoph Hellwig , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-fsdevel@vger.kernel.org" Subject: Re: [PATCH] mmotm: fix hang at startup Message-ID: <20110501032507.GA21118@localhost> References: <201104300002.p3U02Ma2026266@imap1.linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1450 Lines: 45 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 Thanks! Reviewed-by: Wu Fengguang > 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/