From 48bde86df0acb9f53c4fd0908d023ecae962762f Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 15 Dec 2009 16:46:49 -0800 Subject: ext2: report metadata errors during fsync When an IO error happens while writing metadata buffers, we should better report it and call ext2_error since the filesystem is probably no longer consistent. Sometimes such IO errors happen while flushing thread does background writeback, the buffer gets later evicted from memory, and thus the only trace of the error remains as AS_EIO bit set in blockdevice's mapping. So we check this bit in ext2_fsync and report the error although we cannot be really sure which buffer we failed to write. Signed-off-by: Jan Kara Cc: Chris Mason Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/ext2/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/ext2/dir.c') diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index fc2bd05..7516957 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -721,5 +721,5 @@ const struct file_operations ext2_dir_operations = { #ifdef CONFIG_COMPAT .compat_ioctl = ext2_compat_ioctl, #endif - .fsync = simple_fsync, + .fsync = ext2_fsync, }; -- cgit v1.1