Browse Source

ocfs2_file_write_iter: keep return value and current position update in sync

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 10 years ago
parent
commit
9ce5a232b8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      fs/ocfs2/file.c

+ 1 - 1
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,