summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/fat/inode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index e3bb7b4713f2..ef1f826179cd 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -646,8 +646,13 @@ static int fat_sync_inode_metadata(struct inode *inode,
* Buffer present? We leave buffer_dirty check for sync_dirty_buffer()
* for proper synchronization with ongoing IO.
*/
- if (bh && buffer_uptodate(bh))
+ if (bh && buffer_uptodate(bh)) {
sync_dirty_buffer(bh);
+ if (buffer_write_io_error(bh)) {
+ brelse(bh);
+ return -EIO;
+ }
+ }
brelse(bh);
return mmb_sync(&MSDOS_I(inode)->i_metadata_bhs);
}