aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-04-08 15:45:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-08 16:59:12 -0400
commit9ce5a232b8a941be9e74c055535d81508207a570 (patch)
tree472b0dd45ae46039ed0e795cf2d9910a68fd81fe /fs/ocfs2
parentcf1b5ea1c5cd26a003b01d4798266a4bdf0ffe64 (diff)
ocfs2_file_write_iter: keep return value and current position update in sync
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 099972490f39..a39067f4dd55 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2408,7 +2408,6 @@ relock:
2408 goto out_dio; 2408 goto out_dio;
2409 } 2409 }
2410 2410
2411 iocb->ki_pos = *ppos + written_buffered;
2412 /* We need to ensure that the page cache pages are written to 2411 /* We need to ensure that the page cache pages are written to
2413 * disk and invalidated to preserve the expected O_DIRECT 2412 * disk and invalidated to preserve the expected O_DIRECT
2414 * semantics. 2413 * semantics.
@@ -2417,6 +2416,7 @@ relock:
2417 ret = filemap_write_and_wait_range(file->f_mapping, *ppos, 2416 ret = filemap_write_and_wait_range(file->f_mapping, *ppos,
2418 endbyte); 2417 endbyte);
2419 if (ret == 0) { 2418 if (ret == 0) {
2419 iocb->ki_pos = *ppos + written_buffered;
2420 written += written_buffered; 2420 written += written_buffered;
2421 invalidate_mapping_pages(mapping, 2421 invalidate_mapping_pages(mapping,
2422 *ppos >> PAGE_CACHE_SHIFT, 2422 *ppos >> PAGE_CACHE_SHIFT,