ext3: Fix fsync error handling after filesystem abort.
authorDmitry Monakhov <dmonakhov@openvz.org>
Tue, 28 May 2013 09:19:01 +0000 (13:19 +0400)
committerJan Kara <jack@suse.cz>
Thu, 4 Jul 2013 17:22:55 +0000 (19:22 +0200)
commit3df32196519d1556b8851b610ca1aa68c5b673d3
tree4d94cec2052684e7b2a27ca4769654aceca2ca9e
parenta1457c0ce976bad1356b9b0437f2a5c3ab8a9cfc
ext3: Fix fsync error handling after filesystem abort.

If filesystem was aborted we will return success
due to (sb->s_flags & MS_RDONLY) which is incorrect and
results in data loss.
In order to handle fs abort correctly we have to check
fs state once we discover that it is in MS_RDONLY state

Test case: http://patchwork.ozlabs.org/patch/244297/
Changes from V1:
 - fix spelling
 - fix smp_rmb()/debug order

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext3/fsync.c
fs/ext3/super.c