Merge pull request #154 from truenas/truenas/zfs-2.2-release-rc3

Merge after upstream zfs-2.2-release rc3 tag
This commit is contained in:
Ameer Hamza 2023-08-01 01:07:32 +05:00 committed by GitHub
commit b2e707cd3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

2
META
View File

@ -2,7 +2,7 @@ Meta: 1
Name: zfs
Branch: 1.0
Version: 2.2.0
Release: rc2
Release: rc3
Release-Tags: relext
License: CDDL
Author: OpenZFS

View File

@ -6290,7 +6290,7 @@ zfs_freebsd_copy_file_range(struct vop_copy_file_range_args *ap)
error = zfs_clone_range(VTOZ(invp), ap->a_inoffp, VTOZ(outvp),
ap->a_outoffp, &len, ap->a_outcred);
if (error == EXDEV)
if (error == EXDEV || error == EOPNOTSUPP)
goto bad_locked_fallback;
*ap->a_lenp = (size_t)len;
out_locked:

View File

@ -1078,6 +1078,16 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
return (SET_ERROR(EXDEV));
}
/*
* outos and inos belongs to the same storage pool.
* see a few lines above, only one check.
*/
if (!spa_feature_is_enabled(dmu_objset_spa(outos),
SPA_FEATURE_BLOCK_CLONING)) {
zfs_exit_two(inzfsvfs, outzfsvfs, FTAG);
return (SET_ERROR(EOPNOTSUPP));
}
ASSERT(!outzfsvfs->z_replay);
error = zfs_verify_zp(inzp);
@ -1088,12 +1098,6 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
return (error);
}
if (!spa_feature_is_enabled(dmu_objset_spa(outos),
SPA_FEATURE_BLOCK_CLONING)) {
zfs_exit_two(inzfsvfs, outzfsvfs, FTAG);
return (SET_ERROR(EXDEV));
}
/*
* We don't copy source file's flags that's why we don't allow to clone
* files that are in quarantine.