linux/fs/ext4
Hidehiro Kawai 9c83a923c6 ext4: don't read inode block if the buffer has a write error
A transient I/O error can corrupt inode data.  Here is the scenario:

(1) update inode_A at the block_B
(2) pdflush writes out new inode_A to the filesystem, but it results
    in write I/O error, at this point, BH_Uptodate flag of the buffer
    for block_B is cleared and BH_Write_EIO is set
(3) create new inode_C which located at block_B, and
    __ext4_get_inode_loc() tries to read on-disk block_B because the
    buffer is not uptodate
(4) if it can read on-disk block_B successfully, inode_A is
    overwritten by old data

This patch makes __ext4_get_inode_loc() not read the inode block if the
buffer has BH_Write_EIO flag.  In this case, the buffer should have the
latest information, so setting the uptodate flag to the buffer (this
avoids WARN_ON_ONCE() in mark_buffer_dirty().)

According to this change, we would need to test BH_Write_EIO flag for the
error checking.  Currently nobody checks write I/O errors on metadata
buffers, but it will be done in other patches I'm working on.

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: sugita <yumiko.sugita.yf@hitachi.com>
Cc: Satoshi OSHIMA <satoshi.oshima.fk@hitachi.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Jan Kara <jack@ucw.cz>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-07-26 16:39:26 -04:00
..
Makefile ext4: Add multi block allocator for ext4 2008-01-29 00:19:52 -05:00
acl.c [PATCH] sanitize ->permission() prototype 2008-07-26 20:53:14 -04:00
acl.h [PATCH] sanitize ->permission() prototype 2008-07-26 20:53:14 -04:00
balloc.c ext4: lock block groups when initializing 2008-08-02 21:21:08 -04:00
bitmap.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
dir.c ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
ext4.h ext4: delayed allocation i_blocks fix for stat 2008-07-11 19:27:31 -04:00
ext4_extents.h ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
ext4_i.h ext4: delayed allocation ENOSPC handling 2008-07-14 17:52:37 -04:00
ext4_jbd2.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
ext4_jbd2.h ext4: Use new framework for data=ordered mode in JBD2 2008-07-11 19:27:31 -04:00
ext4_sb.h ext4: New inode allocation for FLEX_BG meta-data groups. 2008-07-11 19:27:31 -04:00
extents.c ext4: Fix data corruption when writing to prealloc area 2008-08-02 18:51:32 -04:00
file.c ext4: delayed allocation i_blocks fix for stat 2008-07-11 19:27:31 -04:00
fsync.c ext4: call blkdev_issue_flush on fsync 2008-07-11 19:27:31 -04:00
group.h ext4: Rename read_block_bitmap() to ext4_read_block_bitmap() 2008-07-11 19:27:31 -04:00
hash.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
ialloc.c ext4: lock block groups when initializing 2008-08-02 21:21:08 -04:00
inode.c ext4: don't read inode block if the buffer has a write error 2008-07-26 16:39:26 -04:00
ioctl.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
mballoc.c ext4: Don't allow lg prealloc list to be grow large. 2008-07-23 14:14:05 -04:00
mballoc.h ext4: Don't allow lg prealloc list to be grow large. 2008-07-23 14:14:05 -04:00
migrate.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
namei.c ext4: cleanup never-used magic numbers from htree code 2008-07-11 19:27:31 -04:00
namei.h [PATCH] ext4: rename ext4 symbols to avoid duplication of ext3 symbols 2006-10-11 11:14:15 -07:00
resize.c ext4: fix online resize with mballoc 2008-07-11 19:27:31 -04:00
super.c ext4: lock block groups when initializing 2008-08-02 21:21:08 -04:00
symlink.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
xattr.c ext4: Use inode preallocation with -o noextents 2008-07-11 19:27:31 -04:00
xattr.h ext4: make ext4_xattr_list() static 2008-04-17 10:38:59 -04:00
xattr_security.c ext4: move headers out of include/linux 2008-04-29 18:13:32 -04:00
xattr_trusted.c ext4: remove double definitions of xattr macros 2008-07-11 19:27:31 -04:00
xattr_user.c ext4: remove double definitions of xattr macros 2008-07-11 19:27:31 -04:00