mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Pointed out by: Ka Ho Ng <khng@freebsd.org> Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net> Closes #15772
This commit is contained in:
committed by
Brian Behlendorf
parent
d2f7b2e557
commit
ef527958c6
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user