Re: [PATCH 1/5] jbd: strictly check for write errors on data buffers

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andreas Dilger <adilger@...>
Cc: Andrew Morton <akpm@...>, Theodore Tso <tytso@...>, Jan Kara <jack@...>, <sct@...>, <linux-kernel@...>, <linux-ext4@...>, <jbacik@...>, <cmm@...>, <yumiko.sugita.yf@...>, <satoshi.oshima.fk@...>
Date: Monday, June 9, 2008 - 6:09 am

Andreas Dilger wrote:


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 <hidehiro.kawai.ez@hitachi.com>
---
 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);
 



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 5/5] ext3: abort ext3 if the journal has aborted, Hidehiro Kawai, (Mon Jun 2, 6:48 am)
[PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Mon Jun 2, 6:47 am)
[PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Tue Jun 3, 12:40 am)
Re: [PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Mon Jun 23, 7:14 am)
Re: [PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Tue Jun 24, 7:52 am)
Re: [PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Fri Jun 27, 4:06 am)
Re: [PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Mon Jun 30, 1:09 am)
Re: [PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Tue Jun 3, 1:11 am)
Re: [PATCH 4/5] jbd: fix error handling for checkpoint io, Hidehiro Kawai, (Tue Jun 3, 12:31 am)
[PATCH 2/5] jbd: ordered data integrity fix, Hidehiro Kawai, (Mon Jun 2, 6:45 am)
Re: [PATCH 2/5] jbd: ordered data integrity fix, Andrew Morton, (Tue Jun 3, 6:33 pm)
Re: [PATCH 2/5] jbd: ordered data integrity fix, Hidehiro Kawai, (Wed Jun 4, 6:55 am)
Re: [PATCH 2/5] jbd: ordered data integrity fix, Jan Kara, (Mon Jun 2, 7:59 am)
Re: [PATCH 1/5] jbd: strictly check for write errors on data..., Hidehiro Kawai, (Mon Jun 9, 6:09 am)