From nobody Mon Sep 11 19:48:24 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rky203bjPz4t1Tt; Mon, 11 Sep 2023 19:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rky2038fKz4Hhn; Mon, 11 Sep 2023 19:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694461704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DOG2wHRuA2Ma7bvlpZV+Fn37EmBzANP7fo8U+5ySzkg=; b=tiTIbpyor6151Q7wMZKEPQevJ8EIBj5dTcDtroTupPzVR+YUjl/8fEQunuLEJK766eGPLF D3NttoNev/ZDndRAjGUsgXCKJ1awzwk/faAX1CBoMXXw2FiPe+M4saICQvQg7UGidkSR6T 7hifKjvg4IMAOy73OQfCfIieWD/aYqLb5Z1nWSfOFvLIbljjgsvf92SiuYCrMlq3NHcxk0 m8XFaTTvKSZAzvl8tr4LV/2BlPu0Y11mxEZt6ojVh7c04AhNXDRRTr2sjtD/DNYfPpHJha ofXpghClxXEiQH9uFBoacArLmfWnVcNa4bs/7EfF9Kca0yaxUMhafBNOzwhppw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694461704; a=rsa-sha256; cv=none; b=or4lHpZA17mZ3IEJXF85c9OlVclEW0HRUd+qq8EV1x/0PjGRZ5lmO6fcmhf5CQFxPqUwQg NWtd+sR0y3C+92ZI8SWmD4XdZsRtqOt5Cet9efWpAz8OFTnhlLPCF2HfMvrnt2TEQLQvV2 nulhhDrReHrLvf82nNfmJ1G4T3neygxya80qaSV7rqqb0mrFIIHoUvgqejAdVs7lOCRQ8T tx+mbBL7U9P6cw7hx7r5duDUhBwGB+tUg5HrON2mqpgfgdck7Fd/VzU+seYz4MO8C6hXzB r09sJUgSPo81nlBxmzTf+flw4jM0PLd18hoGSGdjSU1JO2A92zxKA6Bp6DVETQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694461704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DOG2wHRuA2Ma7bvlpZV+Fn37EmBzANP7fo8U+5ySzkg=; b=AYJ36gUq7P1iV2SPyp+7hJryAXSC7K8zZ+TUVyrCzBqmrLA78TiNj5Cfbt+Ie9/SF2mICH JgxaAFX3g0f5V1WoksLwnce2m12m6IEcG+A7voY75G+fyDczSUEBa5Nf8W10n2gG40BGPU oGuWewNNR2ijbm/c3DwucMtVD5VHsn/ScO71zzBTzkXbgYxkZpfgnWuihi56X7rlrQ7qtP lgmPv8QQZZk3SpdcR2mj+uUS/AT7HyA0/XG0Otoj0s/OuPFKulC0r8CaVlo33DHWHd9it1 wr8WKcCz2v+mciEHNm6+VxBmBG4JpH0ySVCO99fo3G1bFbtettil5ym6nccAYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rky2026Pdz12gQ; Mon, 11 Sep 2023 19:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38BJmOfR073706; Mon, 11 Sep 2023 19:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38BJmO4Q073703; Mon, 11 Sep 2023 19:48:24 GMT (envelope-from git) Date: Mon, 11 Sep 2023 19:48:24 GMT Message-Id: <202309111948.38BJmO4Q073703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 9dcf00aa404b - releng/14.0 - zfs: merge openzfs/zfs@e96fbdba3 (zfs-2.2-release) into stable/14 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 9dcf00aa404bb62052433c45aaa5475e2760f5ed Auto-Submitted: auto-generated The branch releng/14.0 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=9dcf00aa404bb62052433c45aaa5475e2760f5ed commit 9dcf00aa404bb62052433c45aaa5475e2760f5ed Author: Martin Matuska AuthorDate: 2023-09-11 07:20:55 +0000 Commit: Martin Matuska CommitDate: 2023-09-11 19:47:08 +0000 zfs: merge openzfs/zfs@e96fbdba3 (zfs-2.2-release) into stable/14 Notable upstream pull request merges: #15251 Add more constraints for block cloning Obtained from: OpenZFS OpenZFS commit: e96fbdba344e9c25cad624a10d4a4b300fd35f6c Approved by: re (gjb) (cherry picked from commit 2b2fbeb3a97b44e88b1ca1a01a9671a8be9fd04f) --- sys/contrib/openzfs/META | 2 +- .../openzfs/module/os/linux/zfs/qat_compress.c | 2 ++ sys/contrib/openzfs/module/zfs/zfs_vnops.c | 21 +++++++++++++++++++-- sys/modules/zfs/zfs_config.h | 4 ++-- sys/modules/zfs/zfs_gitrev.h | 2 +- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/sys/contrib/openzfs/META b/sys/contrib/openzfs/META index e4e770026b57..0953cc51922f 100644 --- a/sys/contrib/openzfs/META +++ b/sys/contrib/openzfs/META @@ -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 diff --git a/sys/contrib/openzfs/module/os/linux/zfs/qat_compress.c b/sys/contrib/openzfs/module/os/linux/zfs/qat_compress.c index 07d5d34dae33..6d0595dd5f76 100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/qat_compress.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/qat_compress.c @@ -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); diff --git a/sys/contrib/openzfs/module/zfs/zfs_vnops.c b/sys/contrib/openzfs/module/zfs/zfs_vnops.c index f8d13075d5c0..a64e1e2dc83d 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_vnops.c +++ b/sys/contrib/openzfs/module/zfs/zfs_vnops.c @@ -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; } @@ -1358,6 +1369,12 @@ unlock: *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); diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h index 29425d3368e0..122a7a3f032e 100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@ -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" @@ -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" diff --git a/sys/modules/zfs/zfs_gitrev.h b/sys/modules/zfs/zfs_gitrev.h index 71be2d813a0a..f29b7621500d 100644 --- a/sys/modules/zfs/zfs_gitrev.h +++ b/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"