From patchwork Tue Dec 2 11:06:47 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshiyuki Okajima X-Patchwork-Id: 11753 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B60BCDDDED for ; Tue, 2 Dec 2008 22:20:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752909AbYLBLUX (ORCPT ); Tue, 2 Dec 2008 06:20:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752997AbYLBLUX (ORCPT ); Tue, 2 Dec 2008 06:20:23 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:34317 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752909AbYLBLUW (ORCPT ); Tue, 2 Dec 2008 06:20:22 -0500 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id mB2BKIG1002324 for (envelope-from toshi.okajima@jp.fujitsu.com); Tue, 2 Dec 2008 20:20:18 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id D4D6D45DD77 for ; Tue, 2 Dec 2008 20:20:17 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id A13EF45DD79 for ; Tue, 2 Dec 2008 20:20:17 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 775681DB803F for ; Tue, 2 Dec 2008 20:20:17 +0900 (JST) Received: from ml14.s.css.fujitsu.com (ml14.s.css.fujitsu.com [10.249.87.104]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 2D99F1DB803A for ; Tue, 2 Dec 2008 20:20:14 +0900 (JST) Received: from ml14.css.fujitsu.com (ml14 [127.0.0.1]) by ml14.s.css.fujitsu.com (Postfix) with ESMTP id F1EAA9F5D71; Tue, 2 Dec 2008 20:20:13 +0900 (JST) Received: from stratos.soft.fujitsu.com (stratos.soft.fujitsu.com [10.124.101.114]) by ml14.s.css.fujitsu.com (Postfix) with SMTP id 7AD279F5D6F; Tue, 2 Dec 2008 20:20:13 +0900 (JST) Date: Tue, 2 Dec 2008 20:06:47 +0900 From: Toshiyuki Okajima To: aneesh.kumar@linux.vnet.ibm.com, balbir@linux.vnet.ibm.com, tytso@mit.edu Cc: linux-ext4@vger.kernel.org Subject: [BUG][PATCH 1/4] ext3: fix a cause of __schedule_bug via blkdev_releasepage Message-Id: <20081202200647.72cc5807.toshi.okajima@jp.fujitsu.com> Organization: Fujitsu co.,ltd. X-Mailer: Sylpheed 2.5.0 (GTK+ 2.14.4; i386-redhat-linux-gnu) Mime-Version: 1.0 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ext3: fix a cause of __schedule_bug via blkdev_releasepage From: Toshiyuki Okajima A cause of this problem is calling log_wait_commit() on journal_try_to_free_buffers() with a read-lock via blkdev_releasepage(). This logic is for uncommitted data buffers. And a read/write-lock is required for a client usage of blkdev_releasepage. By the way, we want to release only metadata buffers on ext3_release_metadata(). Because a page which binds to blkdev is used as metadata for ext3. Therefore we don't need to wait for a commit on journal_try_to_free_buffers() via ext3_release_matadata(). As a result, we add a journal_try_to_free_metadata_buffers() almost same as journal_try_to_free_buffers() except not calling log_wait_commit. So, we change journal_try_to_free_buffers() with journal_try_to_free_metadata_buffers(). This issue was reported by Aneesh Kumar K.V. http://marc.info/?l=linux-ext4&m=122814568309893&w=2 Reported-by: "Aneesh Kumar K.V" Signed-off-by: Toshiyuki Okajima Cc: Balbir Singh Cc: "Theodore Ts'o" --- fs/ext3/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -Nurp linux-2.6.28-rc6/fs/ext3/inode.c linux-2.6.28-rc6.2/fs/ext3/inode.c --- linux-2.6.28-rc6/fs/ext3/inode.c 2008-12-02 09:32:27.000000000 +0900 +++ linux-2.6.28-rc6.2/fs/ext3/inode.c 2008-12-02 10:19:53.000000000 +0900 @@ -1696,7 +1696,7 @@ int ext3_release_metadata(void *client, BUG_ON(EXT3_SB(sb) == NULL); journal = EXT3_SB(sb)->s_journal; if (journal != NULL) - return journal_try_to_free_buffers(journal, page, wait); + return journal_try_to_free_metadata_buffers(journal, page, wait); else return try_to_free_buffers(page); }