aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2010-04-14 08:38:33 -0400
committerJan Kara <jack@suse.cz>2010-05-21 13:30:38 -0400
commit2b8120efb2d41e2aefce3b06cf3fd085f71e9021 (patch)
tree638dece002c64eed3758e909bca7328d6ab728f7
parent41d1a636b813867339db52e12377ca132d54700f (diff)
ext2: Use ext2_clear_super_error() in ext2_sync_fs()
ext2_sync_fs() used to duplicate the code from ext2_clear_super_error(). Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/ext2/super.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 42e4a303b675..8e8b675ac202 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1120,8 +1120,8 @@ static void ext2_clear_super_error(struct super_block *sb)
1120 * be remapped. Nothing we can do but to retry the 1120 * be remapped. Nothing we can do but to retry the
1121 * write and hope for the best. 1121 * write and hope for the best.
1122 */ 1122 */
1123 printk(KERN_ERR "EXT2-fs: %s previous I/O error to " 1123 ext2_msg(sb, KERN_ERR,
1124 "superblock detected", sb->s_id); 1124 "previous I/O error to superblock detected\n");
1125 clear_buffer_write_io_error(sbh); 1125 clear_buffer_write_io_error(sbh);
1126 set_buffer_uptodate(sbh); 1126 set_buffer_uptodate(sbh);
1127 } 1127 }
@@ -1161,23 +1161,9 @@ static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es)
1161static int ext2_sync_fs(struct super_block *sb, int wait) 1161static int ext2_sync_fs(struct super_block *sb, int wait)
1162{ 1162{
1163 struct ext2_super_block *es = EXT2_SB(sb)->s_es; 1163 struct ext2_super_block *es = EXT2_SB(sb)->s_es;
1164 struct buffer_head *sbh = EXT2_SB(sb)->s_sbh;
1165 1164
1166 lock_kernel(); 1165 lock_kernel();
1167 if (buffer_write_io_error(sbh)) { 1166 ext2_clear_super_error(sb);
1168 /*
1169 * Oh, dear. A previous attempt to write the
1170 * superblock failed. This could happen because the
1171 * USB device was yanked out. Or it could happen to
1172 * be a transient write error and maybe the block will
1173 * be remapped. Nothing we can do but to retry the
1174 * write and hope for the best.
1175 */
1176 ext2_msg(sb, KERN_ERR,
1177 "previous I/O error to superblock detected\n");
1178 clear_buffer_write_io_error(sbh);
1179 set_buffer_uptodate(sbh);
1180 }
1181 1167
1182 if (es->s_state & cpu_to_le16(EXT2_VALID_FS)) { 1168 if (es->s_state & cpu_to_le16(EXT2_VALID_FS)) {
1183 ext2_debug("setting valid to 0\n"); 1169 ext2_debug("setting valid to 0\n");