]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ocfs2_file_write_iter: keep return value and current position update in sync
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 8 Apr 2015 19:45:02 +0000 (15:45 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 8 Apr 2015 20:59:12 +0000 (16:59 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ocfs2/file.c

index 099972490f392dc618a6844972f15874ed1e4573..a39067f4dd55c02619493d6af665f5920c4aa7fa 100644 (file)
@@ -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,