]> git.hungrycats.org Git - linux/commit
[PATCH] BUG on error handlings in Ext3 under I/O failure condition
authorHisashi Hifumi <hifumi.hisashi@lab.ntt.co.jp>
Tue, 11 Jan 2005 11:30:37 +0000 (03:30 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 11 Jan 2005 11:30:37 +0000 (03:30 -0800)
commit66d272434a1b009b94bab07bae98dec39e0a9706
tree43761b410c49c5351cd49204c5a117c17de65d79
parentb0c7ad6670d714b474f87f7ea6fd9e0396a0f0d5
[PATCH] BUG on error handlings in Ext3 under I/O failure condition

I found bugs on error handlings in the functions arround the ext3 file
system, which cause inadequate completions of synchronous write I/O
operations when disk I/O failures occur.  Both 2.4 and 2.6 have this
problem.

I carried out following experiment:

1.  Mount a ext3 file system on a SCSI disk with ordered mode.
2.  Open a file on the file system with O_SYNC|O_RDWR|O_TRUNC|O_CREAT flag.
3.  Write 512 bytes data to the file by calling write() every 5 seconds, and
     examine return values from the syscall.
     from write().
4.  Disconnect the SCSI cable,  and examine messages from the kernel.

After the SCSI cable is disconnected, write() must fail.  But the result
was different: write() succeeded for a while even though messages of the
kernel notified SCSI I/O error.

By applying following modifications, the above problem was solved.

Signed-off-by: Hisashi Hifumi <hifumi.hisashi@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/buffer.c
fs/fs-writeback.c
fs/jbd/commit.c
include/linux/fs.h