Skip to content

Commit

Permalink
ocfs2_file_write_iter: keep return value and current position update …
Browse files Browse the repository at this point in the history
…in sync

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 8, 2015
1 parent cf1b5ea commit 9ce5a23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,6 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
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.
Expand All @@ -2417,6 +2416,7 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
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,
Expand Down

0 comments on commit 9ce5a23

Please sign in to comment.