Commit 7ed3cd1a authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Darrick J. Wong

iomap: Fix misplaced page flushing

If iomap_unshare_actor() unshares to an inline iomap, the page was
not being flushed.  block_write_end() and __iomap_write_end() already
contain flushes, so adding it to iomap_write_end_inline() seems like
the best place.  That means we can remove it from iomap_write_actor().
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 6cc19c5f
...@@ -717,6 +717,7 @@ iomap_write_end_inline(struct inode *inode, struct page *page, ...@@ -717,6 +717,7 @@ iomap_write_end_inline(struct inode *inode, struct page *page,
WARN_ON_ONCE(!PageUptodate(page)); WARN_ON_ONCE(!PageUptodate(page));
BUG_ON(pos + copied > PAGE_SIZE - offset_in_page(iomap->inline_data)); BUG_ON(pos + copied > PAGE_SIZE - offset_in_page(iomap->inline_data));
flush_dcache_page(page);
addr = kmap_atomic(page); addr = kmap_atomic(page);
memcpy(iomap->inline_data + pos, addr + pos, copied); memcpy(iomap->inline_data + pos, addr + pos, copied);
kunmap_atomic(addr); kunmap_atomic(addr);
...@@ -810,8 +811,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ...@@ -810,8 +811,6 @@ iomap_write_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
copied = iov_iter_copy_from_user_atomic(page, i, offset, bytes); 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, status = iomap_write_end(inode, pos, bytes, copied, page, iomap,
srcmap); srcmap);
if (unlikely(status < 0)) if (unlikely(status < 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment