]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: remove filesize checks for sync I/O journal commit
authorGoldwyn Rodrigues <rgoldwyn@suse.de>
Wed, 10 Dec 2014 23:41:53 +0000 (15:41 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:03 +0000 (17:41 -0800)
commit0ce4dd01a25e0d516d9cf08c5044ba44c2abb1e7
tree2ff34dcecb9dc524b4c39f60b5e98e64b127f9e7
parentfef8d5e4a1daea69602d2a213a546c2f9d2c93d2
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>
fs/ocfs2/file.c