mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
BRT should return EOPNOTSUPP
Return the more descriptive EOPNOTSUPP instead of EXDEV when the storage pool doesn't support block cloning. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rob Norris <rob.norris@klarasystems.com> Signed-off-by: Kay Pedersen <mail@mkwg.de> Closes #15097
This commit is contained in:
+10
-6
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user