Skip to content

Commit

Permalink
zfs: merge openzfs/zfs@e96fbdba3 (zfs-2.2-release) into stable/14
Browse files Browse the repository at this point in the history
Notable upstream pull request merges:
  #15251 Add more constraints for block cloning

Obtained from:	OpenZFS
OpenZFS commit:	e96fbdb
Approved by:	re (gjb)

(cherry picked from commit 2b2fbeb)
  • Loading branch information
mmatuska committed Sep 11, 2023
1 parent f0ed478 commit 9dcf00a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sys/contrib/openzfs/META
Expand Up @@ -2,7 +2,7 @@ Meta: 1
Name: zfs
Branch: 1.0
Version: 2.2.0
Release: rc3
Release: rc4
Release-Tags: relext
License: CDDL
Author: OpenZFS
Expand Down
2 changes: 2 additions & 0 deletions sys/contrib/openzfs/module/os/linux/zfs/qat_compress.c
Expand Up @@ -193,7 +193,9 @@ qat_dc_init(void)
sd.huffType = CPA_DC_HT_FULL_DYNAMIC;
sd.sessDirection = CPA_DC_DIR_COMBINED;
sd.sessState = CPA_DC_STATELESS;
#if (CPA_DC_API_VERSION_NUM_MAJOR == 1 && CPA_DC_API_VERSION_NUM_MINOR < 6)
sd.deflateWindowSize = 7;
#endif
sd.checksum = CPA_DC_ADLER32;
status = cpaDcGetSessionSize(dc_inst_handles[i],
&sd, &sess_size, &ctx_size);
Expand Down
21 changes: 19 additions & 2 deletions sys/contrib/openzfs/module/zfs/zfs_vnops.c
Expand Up @@ -1172,9 +1172,20 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
inblksz = inzp->z_blksz;

/*
* We cannot clone into files with different block size.
* We cannot clone into files with different block size if we can't
* grow it (block size is already bigger or more than one block).
*/
if (inblksz != outzp->z_blksz && outzp->z_size > inblksz) {
if (inblksz != outzp->z_blksz && (outzp->z_size > outzp->z_blksz ||
outzp->z_size > inblksz)) {
error = SET_ERROR(EINVAL);
goto unlock;
}

/*
* Block size must be power-of-2 if destination offset != 0.
* There can be no multiple blocks of non-power-of-2 size.
*/
if (outoff != 0 && !ISP2(inblksz)) {
error = SET_ERROR(EINVAL);
goto unlock;
}
Expand Down Expand Up @@ -1358,6 +1369,12 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
*inoffp += done;
*outoffp += done;
*lenp = done;
} else {
/*
* If we made no progress, there must be a good reason.
* EOF is handled explicitly above, before the loop.
*/
ASSERT3S(error, !=, 0);
}

zfs_exit_two(inzfsvfs, outzfsvfs, FTAG);
Expand Down
4 changes: 2 additions & 2 deletions sys/modules/zfs/zfs_config.h
Expand Up @@ -1074,7 +1074,7 @@
/* #undef ZFS_IS_GPL_COMPATIBLE */

/* Define the project alias string. */
#define ZFS_META_ALIAS "zfs-2.2.0-FreeBSD_g32949f256"
#define ZFS_META_ALIAS "zfs-2.2.0-FreeBSD_ge96fbdba3"

/* Define the project author. */
#define ZFS_META_AUTHOR "OpenZFS"
Expand Down Expand Up @@ -1104,7 +1104,7 @@
#define ZFS_META_NAME "zfs"

/* Define the project release. */
#define ZFS_META_RELEASE "FreeBSD_g32949f256"
#define ZFS_META_RELEASE "FreeBSD_ge96fbdba3"

/* Define the project version. */
#define ZFS_META_VERSION "2.2.0"
Expand Down
2 changes: 1 addition & 1 deletion sys/modules/zfs/zfs_gitrev.h
@@ -1 +1 @@
#define ZFS_META_GITREV "zfs-2.2.0-rc3-31-g32949f256"
#define ZFS_META_GITREV "zfs-2.2.0-rc4-1-ge96fbdba3"

1 comment on commit 9dcf00a

@grahamperrin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenZFS commit: e96fbdb

Please sign in to comment.