iomap: fix page_done callback for short writes
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 28 Jun 2019 00:28:41 +0000 (17:28 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Fri, 28 Jun 2019 00:28:41 +0000 (17:28 -0700)
When we truncate a short write to have it retried, pass the truncated
length to the page_done callback instead of the full length.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/iomap.c

index c4acf69..f15c705 100644 (file)
@@ -799,7 +799,7 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len,
        if (old_size < pos)
                pagecache_isize_extended(inode, old_size, pos);
        if (page_ops && page_ops->page_done)
-               page_ops->page_done(inode, pos, copied, page, iomap);
+               page_ops->page_done(inode, pos, ret, page, iomap);
        put_page(page);
 
        if (ret < len)