aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.de>2014-12-10 18:41:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 20:41:03 -0500
commit86b9c6f3f891019b26f8e5bb11a6faa96bba54a8 (patch)
tree2ff34dcecb9dc524b4c39f60b5e98e64b127f9e7 /fs/ocfs2
parent196fe71d643be8285749726e88c1508536fe03b8 (diff)
ocfs2: remove filesize checks for sync I/O journal commit
Filesize is not a good indication that the file needs to be synced. An example where this breaks is: 1. Open the file in O_SYNC|O_RDWR 2. Read a small portion of the file (say 64 bytes) 3. Lseek to starting of the file 4. Write 64 bytes If the node crashes, it is not written out to disk because this was not committed in the journal and the other node which reads the file after recovery reads stale data (even if the write on the other node was successful) Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de> Reviewed-by: Mark Fasheh <mfasheh@suse.de> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 324dc93ac896..69fb9f75b082 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2381,9 +2381,7 @@ out_dio:
2381 if (ret < 0) 2381 if (ret < 0)
2382 written = ret; 2382 written = ret;
2383 2383
2384 if (!ret && ((old_size != i_size_read(inode)) || 2384 if (!ret) {
2385 (old_clusters != OCFS2_I(inode)->ip_clusters) ||
2386 has_refcount)) {
2387 ret = jbd2_journal_force_commit(osb->journal->j_journal); 2385 ret = jbd2_journal_force_commit(osb->journal->j_journal);
2388 if (ret < 0) 2386 if (ret < 0)
2389 written = ret; 2387 written = ret;