From: Al Viro Date: Wed, 8 Apr 2015 19:45:02 +0000 (-0400) Subject: ocfs2_file_write_iter: keep return value and current position update in sync X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ce5a232b8a941be9e74c055535d81508207a570;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ocfs2_file_write_iter: keep return value and current position update in sync Signed-off-by: Al Viro --- 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: goto out_dio; } - iocb->ki_pos = *ppos + written_buffered; /* We need to ensure that the page cache pages are written to * disk and invalidated to preserve the expected O_DIRECT * semantics. @@ -2417,6 +2416,7 @@ relock: ret = filemap_write_and_wait_range(file->f_mapping, *ppos, endbyte); if (ret == 0) { + iocb->ki_pos = *ppos + written_buffered; written += written_buffered; invalidate_mapping_pages(mapping, *ppos >> PAGE_CACHE_SHIFT,