aboutsummaryrefslogtreecommitdiff
path: root/fs/ext3/fsync.c
diff options
context:
space:
mode:
authorLinus Torvalds2013-07-09 12:08:43 -0700
committerLinus Torvalds2013-07-09 12:08:43 -0700
commit1f792dd1765e6f047ecd2d5f6a81f025b50d471a (patch)
tree1709089f248e26ed23ca0466a5096d210fb16ee2 /fs/ext3/fsync.c
parentc75e24752c0c87938a5955d9056dfb83e8352206 (diff)
parente628753bf925b058b6811527492f7529f4d27691 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext3 fix and quota cleanup from Jan Kara: "A fix of ext3 error reporting from fsync and a quota cleanup" * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: quota: Convert use of typedef ctl_table to struct ctl_table ext3: Fix fsync error handling after filesystem abort.
Diffstat (limited to 'fs/ext3/fsync.c')
-rw-r--r--fs/ext3/fsync.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c
index b31dbd4c46ad..1cb9c7e10c6f 100644
--- a/fs/ext3/fsync.c
+++ b/fs/ext3/fsync.c
@@ -48,9 +48,13 @@ int ext3_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
trace_ext3_sync_file_enter(file, datasync);
- if (inode->i_sb->s_flags & MS_RDONLY)
+ if (inode->i_sb->s_flags & MS_RDONLY) {
+ /* Make sure that we read updated state */
+ smp_rmb();
+ if (EXT3_SB(inode->i_sb)->s_mount_state & EXT3_ERROR_FS)
+ return -EROFS;
return 0;
-
+ }
ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
if (ret)
goto out;