提交 9ce5a232 编写于 作者: A Al Viro

ocfs2_file_write_iter: keep return value and current position update in sync

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 cf1b5ea1
...@@ -2408,7 +2408,6 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb, ...@@ -2408,7 +2408,6 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
goto out_dio; goto out_dio;
} }
iocb->ki_pos = *ppos + written_buffered;
/* We need to ensure that the page cache pages are written to /* We need to ensure that the page cache pages are written to
* disk and invalidated to preserve the expected O_DIRECT * disk and invalidated to preserve the expected O_DIRECT
* semantics. * semantics.
...@@ -2417,6 +2416,7 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb, ...@@ -2417,6 +2416,7 @@ static ssize_t ocfs2_file_write_iter(struct kiocb *iocb,
ret = filemap_write_and_wait_range(file->f_mapping, *ppos, ret = filemap_write_and_wait_range(file->f_mapping, *ppos,
endbyte); endbyte);
if (ret == 0) { if (ret == 0) {
iocb->ki_pos = *ppos + written_buffered;
written += written_buffered; written += written_buffered;
invalidate_mapping_pages(mapping, invalidate_mapping_pages(mapping,
*ppos >> PAGE_CACHE_SHIFT, *ppos >> PAGE_CACHE_SHIFT,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册