aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <[email protected]>2024-01-17 08:51:07 -0800
committerBrian Behlendorf <[email protected]>2024-01-19 12:28:02 -0800
commitef527958c6a1fc07177636465194625ef8e64083 (patch)
tree08423327a93843b807a6516168f3af8086563c4e /module
parentd2f7b2e55767f8b84bcca79cf508f89c0471a92a (diff)
Fix cloning into mmaped and cached file.
If the destination file is mmaped and the mmaped region was already read, so it is cached, we need to update mmaped pages after successful clone using update_pages(). Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Pointed out by: Ka Ho Ng <[email protected]> Signed-off-by: Pawel Jakub Dawidek <[email protected]> Closes #15772
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zfs_vnops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 812e42f64..aa61575a6 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -1355,6 +1355,10 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
break;
}
+ if (zn_has_cached_data(outzp, outoff, outoff + size - 1)) {
+ update_pages(outzp, outoff, size, outos);
+ }
+
zfs_clear_setid_bits_if_necessary(outzfsvfs, outzp, cr,
&clear_setid_bits_txg, tx);