diff -Nru zfs-linux-2.1.1/debian/changelog zfs-linux-2.1.1/debian/changelog --- zfs-linux-2.1.1/debian/changelog 2021-12-08 08:55:48.000000000 +0000 +++ zfs-linux-2.1.1/debian/changelog 2021-12-13 15:38:17.000000000 +0000 @@ -1,3 +1,13 @@ +zfs-linux (2.1.1-3ubuntu1) jammy; urgency=medium + + * Merge from Debian unstable (LP: #1954676). Additional Ubuntu changes: + - re-added spl package in debian/control + - misc debian/control adjustments + - apply fix for potential data corruption during send/recv + (https://github.com/openzfs/zfs/issues/12762) + + -- Andrea Righi Mon, 13 Dec 2021 15:38:17 +0000 + zfs-linux (2.1.1-3) unstable; urgency=medium * Fix pkgcfg path in dkms.mkconf diff -Nru zfs-linux-2.1.1/debian/control zfs-linux-2.1.1/debian/control --- zfs-linux-2.1.1/debian/control 2021-11-26 19:09:10.000000000 +0000 +++ zfs-linux-2.1.1/debian/control 2021-12-13 15:38:17.000000000 +0000 @@ -1,7 +1,8 @@ Source: zfs-linux Section: contrib/kernel Priority: optional -Maintainer: Debian ZFS on Linux maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian ZFS on Linux maintainers Uploaders: Aron Xu , Carlos Alberto Lopez Perez , Mo Zhou @@ -194,7 +195,7 @@ OpenZFS. Package: zfs-initramfs -Architecture: all +Architecture: amd64 arm64 ppc64el s390x riscv64 Depends: busybox-initramfs | busybox-static | busybox, initramfs-tools, zfs-modules | zfs-dkms, @@ -211,7 +212,7 @@ for the initramfs-tools infrastructure. Package: zfs-dracut -Architecture: all +Architecture: amd64 arm64 ppc64el s390x riscv64 Depends: dracut, zfs-modules | zfs-dkms, zfsutils-linux (>= ${source:Version}), @@ -306,3 +307,41 @@ This package provides the OpenZFS test infrastructure for destructively testing and validating a system using OpenZFS. It is entirely optional and should only be installed and used in test environments. + +Package: spl +Section: contrib/metapackages +Architecture: all +Depends: ${misc:Depends} +Suggests: zfs-test +Description: Solaris Porting Layer user-space utilities for Linux (dummy) + The Solaris Porting Layer (SPL) is a Linux kernel module which provides + many of the Solaris kernel APIs. This shim layer makes it possible to + run Solaris kernel code in the Linux kernel with relatively minimal + modification. The Solaris Porting LAyer Tests (SPLAT) is a Linux kernel + module which provides a testing harness for the SPL module. + . + SPL can be particularly useful when you want to track upstream Illumos + (or any other OpenSolaris fork) development closely and don't want the + overhead of maintaining a large patch which converts Solaris primitives + to Linux primitives. + . + This is a transitional dummy package. It can safely be removed. + +Package: spl-dkms +Section: contrib/metapackages +Architecture: all +Depends: zfs-dkms, ${misc:Depends} +Description: Solaris Porting Layer kernel modules for Linux (dummy) + The Solaris Porting Layer (SPL) is a Linux kernel module which provides + many of the Solaris kernel APIs. This shim layer makes it possible to + run Solaris kernel code in the Linux kernel with relatively minimal + modification. The Solaris Porting LAyer Tests (SPLAT) is a Linux kernel + module which provides a testing harness for the SPL module. + . + SPL can be particularly useful when you want to track upstream Illumos + (or any other OpenSolaris fork) development closely and don't want the + overhead of maintaining a large patch which converts Solaris primitives + to Linux primitives. + . + This is a transitional dummy package. It can safely be removed. + SPL dkms files had been merged into zfs-dkms as of ZFS 0.8.X series. diff -Nru zfs-linux-2.1.1/debian/libzfsbootenv1linux-udeb.install zfs-linux-2.1.1/debian/libzfsbootenv1linux-udeb.install --- zfs-linux-2.1.1/debian/libzfsbootenv1linux-udeb.install 1970-01-01 00:00:00.000000000 +0000 +++ zfs-linux-2.1.1/debian/libzfsbootenv1linux-udeb.install 2021-12-13 15:38:17.000000000 +0000 @@ -0,0 +1 @@ +lib/x86_64-linux-gnu/libzfsbootenv/.libs/libzfsbootenv.so.*[0-9] lib/x86_64-linux-gnu diff -Nru zfs-linux-2.1.1/debian/libzfsbootenv1linux.install zfs-linux-2.1.1/debian/libzfsbootenv1linux.install --- zfs-linux-2.1.1/debian/libzfsbootenv1linux.install 1970-01-01 00:00:00.000000000 +0000 +++ zfs-linux-2.1.1/debian/libzfsbootenv1linux.install 2021-12-13 15:38:17.000000000 +0000 @@ -0,0 +1 @@ +lib/x86_64-linux-gnu/libzfsbootenv.so.* diff -Nru zfs-linux-2.1.1/debian/patches/4902-ZFS-send-recv-with-ashift-9-12-leads-to-data-corrupt.patch zfs-linux-2.1.1/debian/patches/4902-ZFS-send-recv-with-ashift-9-12-leads-to-data-corrupt.patch --- zfs-linux-2.1.1/debian/patches/4902-ZFS-send-recv-with-ashift-9-12-leads-to-data-corrupt.patch 1970-01-01 00:00:00.000000000 +0000 +++ zfs-linux-2.1.1/debian/patches/4902-ZFS-send-recv-with-ashift-9-12-leads-to-data-corrupt.patch 2021-12-13 15:38:17.000000000 +0000 @@ -0,0 +1,102 @@ +Description: Fix ZFS send/recv with ashift 9->12 that leads to data +corruption. +Author: Paul Dagnelie +Origin: upstream, https://github.com/openzfs/zfs/commit/57f6a050e67697bc88b2c356fc4bdcfb3b735a6b +--- + module/zfs/arc.c | 1 - + module/zfs/dmu_send.c | 23 +++++++++++++++++------ + 2 files changed, 17 insertions(+), 7 deletions(-) + +diff --git a/module/zfs/arc.c b/module/zfs/arc.c +index b864394b4..875986de9 100644 +--- a/module/zfs/arc.c ++++ b/module/zfs/arc.c +@@ -2063,7 +2063,6 @@ arc_buf_fill(arc_buf_t *buf, spa_t *spa, const zbookmark_phys_t *zb, + } else { + ASSERT(hdr_compressed); + ASSERT(!compressed); +- ASSERT3U(HDR_GET_LSIZE(hdr), !=, HDR_GET_PSIZE(hdr)); + + /* + * If the buf is sharing its data with the hdr, unlink it and +diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c +index 0658e13c2..2f2fd4c3d 100644 +--- a/module/zfs/dmu_send.c ++++ b/module/zfs/dmu_send.c +@@ -165,6 +165,7 @@ struct send_range { + kmutex_t lock; + kcondvar_t cv; + boolean_t io_outstanding; ++ boolean_t io_compressed; + int io_err; + } data; + struct srh { +@@ -450,7 +451,8 @@ dump_redact(dmu_send_cookie_t *dscp, uint64_t object, uint64_t offset, + + static int + dmu_dump_write(dmu_send_cookie_t *dscp, dmu_object_type_t type, uint64_t object, +- uint64_t offset, int lsize, int psize, const blkptr_t *bp, void *data) ++ uint64_t offset, int lsize, int psize, const blkptr_t *bp, ++ boolean_t io_compressed, void *data) + { + uint64_t payload_size; + boolean_t raw = (dscp->dsc_featureflags & DMU_BACKUP_FEATURE_RAW); +@@ -487,7 +489,10 @@ dmu_dump_write(dmu_send_cookie_t *dscp, dmu_object_type_t type, uint64_t object, + drrw->drr_logical_size = lsize; + + /* only set the compression fields if the buf is compressed or raw */ +- if (raw || lsize != psize) { ++ boolean_t compressed = ++ (bp != NULL ? BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF && ++ io_compressed : lsize != psize); ++ if (raw || compressed) { + ASSERT(raw || dscp->dsc_featureflags & + DMU_BACKUP_FEATURE_COMPRESSED); + ASSERT(!BP_IS_EMBEDDED(bp)); +@@ -1014,7 +1019,8 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range) + int n = MIN(srdp->datablksz, + SPA_OLD_MAXBLOCKSIZE); + err = dmu_dump_write(dscp, srdp->obj_type, +- range->object, offset, n, n, NULL, data); ++ range->object, offset, n, n, NULL, B_FALSE, ++ data); + offset += n; + /* + * When doing dry run, data==NULL is used as a +@@ -1028,7 +1034,8 @@ do_dump(dmu_send_cookie_t *dscp, struct send_range *range) + } else { + err = dmu_dump_write(dscp, srdp->obj_type, + range->object, offset, +- srdp->datablksz, srdp->datasz, bp, data); ++ srdp->datablksz, srdp->datasz, bp, ++ srdp->io_compressed, data); + } + return (err); + } +@@ -1081,6 +1088,7 @@ range_alloc(enum type type, uint64_t object, uint64_t start_blkid, + cv_init(&range->sru.data.cv, NULL, CV_DEFAULT, NULL); + range->sru.data.io_outstanding = 0; + range->sru.data.io_err = 0; ++ range->sru.data.io_compressed = B_FALSE; + } + return (range); + } +@@ -1646,10 +1654,13 @@ issue_data_read(struct send_reader_thread_arg *srta, struct send_range *range) + + enum zio_flag zioflags = ZIO_FLAG_CANFAIL; + +- if (srta->featureflags & DMU_BACKUP_FEATURE_RAW) ++ if (srta->featureflags & DMU_BACKUP_FEATURE_RAW) { + zioflags |= ZIO_FLAG_RAW; +- else if (request_compressed) ++ srdp->io_compressed = B_TRUE; ++ } else if (request_compressed) { + zioflags |= ZIO_FLAG_RAW_COMPRESS; ++ srdp->io_compressed = B_TRUE; ++ } + + srdp->datasz = (zioflags & ZIO_FLAG_RAW_COMPRESS) ? + BP_GET_PSIZE(bp) : BP_GET_LSIZE(bp); +-- +2.32.0 + diff -Nru zfs-linux-2.1.1/debian/patches/series zfs-linux-2.1.1/debian/patches/series --- zfs-linux-2.1.1/debian/patches/series 2021-11-27 06:09:45.000000000 +0000 +++ zfs-linux-2.1.1/debian/patches/series 2021-12-13 15:38:17.000000000 +0000 @@ -19,3 +19,4 @@ #ubuntu/4701-enable-ARC-FILL-LOCKED-flag.patch 4900-ppc-get-user-workaround.patch 4901-zvol_wait-Ignore-locked-zvols.patch +4902-ZFS-send-recv-with-ashift-9-12-leads-to-data-corrupt.patch