Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759870AbYFIKJr (ORCPT ); Mon, 9 Jun 2008 06:09:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758695AbYFIKJh (ORCPT ); Mon, 9 Jun 2008 06:09:37 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:53282 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758966AbYFIKJg (ORCPT ); Mon, 9 Jun 2008 06:09:36 -0400 X-AuditID: 0ac90647-ab321ba000004aeb-8a-484d015e3562 Message-ID: <484D0155.4040701@hitachi.com> Date: Mon, 09 Jun 2008 19:09:25 +0900 From: Hidehiro Kawai User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: ja MIME-Version: 1.0 To: Andreas Dilger Cc: Andrew Morton , Theodore Tso , Jan Kara , sct@redhat.com, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, jbacik@redhat.com, cmm@us.ibm.com, yumiko.sugita.yf@hitachi.com, satoshi.oshima.fk@hitachi.com Subject: Re: [PATCH 1/5] jbd: strictly check for write errors on data buffers References: <20080603153050.fb99ac8a.akpm@linux-foundation.org> <20080604101925.GB16572@duck.suse.cz> <20080604111911.c1fe09c6.akpm@linux-foundation.org> <20080604212202.GA8727@mit.edu> <20080604145848.e3da6f20.akpm@linux-foundation.org> <20080604225155.GB8727@mit.edu> <20080605093536.GE27370@duck.suse.cz> <4847CF07.1020904@hitachi.com> <20080605142948.GA25477@mit.edu> <20080605092006.ba7dceef.akpm@linux-foundation.org> <20080605184941.GX2961@webber.adilger.int> In-Reply-To: <20080605184941.GX2961@webber.adilger.int> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2707 Lines: 84 Andreas Dilger wrote: > On Jun 05, 2008 09:20 -0700, Andrew Morton wrote: >>I guess we need to undo this. And yes, propagating errors into AS_EIO >>is the way. I guess that's safe without holding lock_page(), as long >>as the bh is pinned. > > Something like the following instead if -EIO and journal abort: > > if (!buffer_uptodate(bh)) { > set_bit(AS_EIO, &bh->b_page->mapping->flags); > SetPageError(bh->b_page); > } > > It seems end_buffer_async_write() does this already, but > journal_do_submit_data() uses end_buffer_write_sync() and it does not > do either of those operations. Thank you for your suggestion. I wrote an additional patch to do that below. Please apply it as the 6th patch of this patch series. BTW, I'm developing a patch which makes "abort the journal if a file data buffer has an error" tunable. I'll send it in another thread because it's not a bug fix patch. Regards, -- Hidehiro Kawai Hitachi, Systems Development Laboratory Linux Technology Center Subject: JBD: don't abort if flushing file data failed In ordered mode, it is not appropriate behavior to abort the journal when we failed to write file data. This patch calls printk() instead of aborting the journal. Additionally, set AS_EIO into the address_space object of the buffer which is written out by journal_do_submit_data() and failed so that fsync() can get -EIO. Signed-off-by: Hidehiro Kawai --- fs/jbd/commit.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) Index: linux-2.6.26-rc4/fs/jbd/commit.c =================================================================== --- linux-2.6.26-rc4.orig/fs/jbd/commit.c +++ linux-2.6.26-rc4/fs/jbd/commit.c @@ -432,8 +432,11 @@ void journal_commit_transaction(journal_ wait_on_buffer(bh); spin_lock(&journal->j_list_lock); } - if (unlikely(!buffer_uptodate(bh))) + if (unlikely(!buffer_uptodate(bh))) { + set_bit(AS_EIO, &bh->b_page->mapping->flags); + SetPageError(bh->b_page); err = -EIO; + } if (!inverted_lock(journal, bh)) { put_bh(bh); spin_lock(&journal->j_list_lock); @@ -452,8 +455,11 @@ void journal_commit_transaction(journal_ } spin_unlock(&journal->j_list_lock); - if (err) - journal_abort(journal, err); + if (err) { + printk(KERN_WARNING + "JBD: Detected IO errors during flushing file data\n"); + err = 0; + } journal_write_revoke_records(journal, commit_transaction); -- 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/