VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Matthew Wilcox (Oracle) <willy@infradead.org> 2020-09-21 08:58:38 -0700 committer: Darrick J. Wong <darrick.wong@oracle.com> 2020-09-21 08:59:26 -0700 commit: 7ed3cd1a69e3aedb29d4edf0b02624a1833a952d parent: 6cc19c5fad0908e4e5ed99c2236d740668985364
Commit Summary:
iomap: Fix misplaced page flushing
Diffstat:
1 file changed, 1 insertion, 2 deletions
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 2b4757dba825..d8013f38a317 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -717,6 +717,7 @@ iomap_write_end_inline(struct inode *inode, struct page *page,
 	WARN_ON_ONCE(!PageUptodate(page));
 	BUG_ON(pos + copied > PAGE_SIZE - offset_in_page(iomap->inline_data));
 
+	flush_dcache_page(page);
 	addr = kmap_atomic(page);
 	memcpy(iomap->inline_data + pos, addr + pos, copied);
 	kunmap_atomic(addr);
@@ -810,8 +811,6 @@ again:
 
 		copied = iov_iter_copy_from_user_atomic(page, i, offset, bytes);
 
-		flush_dcache_page(page);
-
 		status = iomap_write_end(inode, pos, bytes, copied, page, iomap,
 				srcmap);
 		if (unlikely(status < 0))