summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHidehiro Kawai <hidehiro.kawai.ez@hitachi.com>2008-10-22 14:15:02 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-12-13 15:29:16 -0800
commiteb6abcfe147282b257b5411a31a91ae1d083ec82 (patch)
treeb8ffcf73dab7029345408eeadfad54f4506a7966 /fs
parentb43a0b325c7e28db51c3f4a0aaa8499518fa9b3b (diff)
jbd: test BH_Write_EIO to detect errors on metadata buffers
commit 9f818b4ac04f53458d0354950b4f229f54be4dbf upstream. __try_to_free_cp_buf(), __process_buffer(), and __wait_cp_io() test BH_Uptodate flag to detect write I/O errors on metadata buffers. But by commit 95450f5a7e53d5752ce1a0d0b8282e10fe745ae0 "ext3: don't read inode block if the buffer has a write error"(*), BH_Uptodate flag can be set to inode buffers with BH_Write_EIO in order to avoid reading old inode data. So now, we have to test BH_Write_EIO flag of checkpointing inode buffers instead of BH_Uptodate. This patch does it. Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> Acked-by: Jan Kara <jack@suse.cz> Acked-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/jbd/checkpoint.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index e29293501d42..fe8521933243 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -94,7 +94,7 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
struct buffer_head *bh = jh2bh(jh);
if (jh->b_jlist == BJ_None && !buffer_locked(bh) &&
- !buffer_dirty(bh) && buffer_uptodate(bh)) {
+ !buffer_dirty(bh) && !buffer_write_io_error(bh)) {
JBUFFER_TRACE(jh, "remove from checkpoint list");
ret = __journal_remove_checkpoint(jh) + 1;
jbd_unlock_bh_state(bh);
@@ -199,7 +199,7 @@ restart:
spin_lock(&journal->j_list_lock);
goto restart;
}
- if (unlikely(!buffer_uptodate(bh)))
+ if (unlikely(buffer_write_io_error(bh)))
ret = -EIO;
/*
@@ -268,7 +268,7 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
ret = 1;
} else if (!buffer_dirty(bh)) {
ret = 1;
- if (unlikely(!buffer_uptodate(bh)))
+ if (unlikely(buffer_write_io_error(bh)))
ret = -EIO;
J_ASSERT_JH(jh, !buffer_jbddirty(bh));
BUFFER_TRACE(bh, "remove from checkpoint");