diff options
author | Dave Airlie <airlied@redhat.com> | 2018-11-28 19:34:03 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-11-28 19:34:03 -0500 |
commit | 1ec28f8b8ada4e4f77d1af006a3a474f4f83b8e3 (patch) | |
tree | 2e810e02a66cdec0bc82a8555796b7083ad03416 /fs/xfs/xfs_reflink.c | |
parent | 61647c77cb15354a329cbb36fe7a2253b36b51b1 (diff) | |
parent | 2e6e902d185027f8e3cb8b7305238f7e35d6a436 (diff) |
Merge v4.20-rc4 into drm-next
Requested by Boris Brezillon for some vc4 fixes that are needed for future vc4 work.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
-rw-r--r-- | fs/xfs/xfs_reflink.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index ecdb086bc23e..322a852ce284 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c | |||
@@ -296,6 +296,7 @@ xfs_reflink_reserve_cow( | |||
296 | if (error) | 296 | if (error) |
297 | return error; | 297 | return error; |
298 | 298 | ||
299 | xfs_trim_extent(imap, got.br_startoff, got.br_blockcount); | ||
299 | trace_xfs_reflink_cow_alloc(ip, &got); | 300 | trace_xfs_reflink_cow_alloc(ip, &got); |
300 | return 0; | 301 | return 0; |
301 | } | 302 | } |
@@ -1351,10 +1352,19 @@ xfs_reflink_remap_prep( | |||
1351 | if (ret) | 1352 | if (ret) |
1352 | goto out_unlock; | 1353 | goto out_unlock; |
1353 | 1354 | ||
1354 | /* Zap any page cache for the destination file's range. */ | 1355 | /* |
1355 | truncate_inode_pages_range(&inode_out->i_data, | 1356 | * If pos_out > EOF, we may have dirtied blocks between EOF and |
1356 | round_down(pos_out, PAGE_SIZE), | 1357 | * pos_out. In that case, we need to extend the flush and unmap to cover |
1357 | round_up(pos_out + *len, PAGE_SIZE) - 1); | 1358 | * from EOF to the end of the copy length. |
1359 | */ | ||
1360 | if (pos_out > XFS_ISIZE(dest)) { | ||
1361 | loff_t flen = *len + (pos_out - XFS_ISIZE(dest)); | ||
1362 | ret = xfs_flush_unmap_range(dest, XFS_ISIZE(dest), flen); | ||
1363 | } else { | ||
1364 | ret = xfs_flush_unmap_range(dest, pos_out, *len); | ||
1365 | } | ||
1366 | if (ret) | ||
1367 | goto out_unlock; | ||
1358 | 1368 | ||
1359 | return 1; | 1369 | return 1; |
1360 | out_unlock: | 1370 | out_unlock: |