diff options
Diffstat (limited to 'fs/ext4/fsync.c')
-rw-r--r-- | fs/ext4/fsync.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index fc938eb..a8bc47f 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -98,8 +98,13 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync) trace_ext4_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 s_mount_flags value */ + smp_rmb(); + if (EXT4_SB(inode->i_sb)->s_mount_flags & EXT4_MF_FS_ABORTED) + ret = -EROFS; goto out; + } if (!journal) { ret = generic_file_fsync(file, start, end, datasync); |