diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/ext2/file.c | 5 | ||||
| -rw-r--r-- | fs/libfs.c | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/fs/ext2/file.c b/fs/ext2/file.c index b21891a6bfca..d34d32bdc944 100644 --- a/fs/ext2/file.c +++ b/fs/ext2/file.c | |||
| @@ -174,15 +174,12 @@ int ext2_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
| 174 | { | 174 | { |
| 175 | int ret; | 175 | int ret; |
| 176 | struct super_block *sb = file->f_mapping->host->i_sb; | 176 | struct super_block *sb = file->f_mapping->host->i_sb; |
| 177 | struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; | ||
| 178 | 177 | ||
| 179 | ret = generic_file_fsync(file, start, end, datasync); | 178 | ret = generic_file_fsync(file, start, end, datasync); |
| 180 | if (ret == -EIO || test_and_clear_bit(AS_EIO, &mapping->flags)) { | 179 | if (ret == -EIO) |
| 181 | /* We don't really know where the IO error happened... */ | 180 | /* We don't really know where the IO error happened... */ |
| 182 | ext2_error(sb, __func__, | 181 | ext2_error(sb, __func__, |
| 183 | "detected IO error when writing metadata buffers"); | 182 | "detected IO error when writing metadata buffers"); |
| 184 | ret = -EIO; | ||
| 185 | } | ||
| 186 | return ret; | 183 | return ret; |
| 187 | } | 184 | } |
| 188 | 185 | ||
diff --git a/fs/libfs.c b/fs/libfs.c index a04395334bb1..1b76f29799bf 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
| @@ -991,7 +991,9 @@ int __generic_file_fsync(struct file *file, loff_t start, loff_t end, | |||
| 991 | 991 | ||
| 992 | out: | 992 | out: |
| 993 | inode_unlock(inode); | 993 | inode_unlock(inode); |
| 994 | return ret; | 994 | /* must call this unconditionally as it clears AS_* error flags */ |
| 995 | err = filemap_check_errors(inode->i_mapping); | ||
| 996 | return ret ? ret : err; | ||
| 995 | } | 997 | } |
| 996 | EXPORT_SYMBOL(__generic_file_fsync); | 998 | EXPORT_SYMBOL(__generic_file_fsync); |
| 997 | 999 | ||
