summaryrefslogtreecommitdiffstats
path: root/fs/ext3/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 12:08:43 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 12:08:43 -0700
commit1f792dd1765e6f047ecd2d5f6a81f025b50d471a (patch)
tree1709089f248e26ed23ca0466a5096d210fb16ee2 /fs/ext3/super.c
parentc75e24752c0c87938a5955d9056dfb83e8352206 (diff)
parente628753bf925b058b6811527492f7529f4d27691 (diff)
downloadlinux-1f792dd1765e6f047ecd2d5f6a81f025b50d471a.tar.gz
linux-1f792dd1765e6f047ecd2d5f6a81f025b50d471a.tar.bz2
linux-1f792dd1765e6f047ecd2d5f6a81f025b50d471a.zip
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/super.c')
-rw-r--r--fs/ext3/super.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 6356665a74bb..c47f14750722 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -174,6 +174,11 @@ static void ext3_handle_error(struct super_block *sb)
if (test_opt (sb, ERRORS_RO)) {
ext3_msg(sb, KERN_CRIT,
"error: remounting filesystem read-only");
+ /*
+ * Make sure updated value of ->s_mount_state will be visible
+ * before ->s_flags update.
+ */
+ smp_wmb();
sb->s_flags |= MS_RDONLY;
}
ext3_commit_super(sb, es, 1);
@@ -291,8 +296,14 @@ void ext3_abort(struct super_block *sb, const char *function,
ext3_msg(sb, KERN_CRIT,
"error: remounting filesystem read-only");
EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS;
- sb->s_flags |= MS_RDONLY;
set_opt(EXT3_SB(sb)->s_mount_opt, ABORT);
+ /*
+ * Make sure updated value of ->s_mount_state will be visible
+ * before ->s_flags update.
+ */
+ smp_wmb();
+ sb->s_flags |= MS_RDONLY;
+
if (EXT3_SB(sb)->s_journal)
journal_abort(EXT3_SB(sb)->s_journal, -EIO);
}