From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6507833F5B1 for ; Sun, 12 Jul 2026 15:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783868800; cv=none; b=MaEGzmhm7u1l7M+abrXlYe3+MLQGcjX8tx1tdYaVLm0tFh25866zmaOfjqX4lRB8cTtI//TH11L/QPIA4Hujxyk+6WXTSZVSEv20courJzqD0L0nhd1hSGTlsjxiU+0Qq8hRKY53jiSveSS+YDvN4cwl7E7TPjfaOxOG3TaBaQI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783868800; c=relaxed/simple; bh=8gIGndJDRf7JgPXBED6EmrFm9hh9tKjJ1kOV2dL0NT4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=gi3D8vX5CfP++9oz8Wdgy3jNQqYSNL/lWtnZoR9p3x5/Hg9p+C+eyOfQW+DF9d11KNYf9g3nDBidN6hyDGPjVfC2NiiIpw9Rk/Ue2inJyrHaPtOiRadYqkCqlZVLPAiR0kGkG1OZhgGDVOVrdeX3sS/xn64ajVQDZZ2RKd+Ljj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gompa.dev; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.161.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gompa.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-6a378a2cfdfso1535965eaf.0 for ; Sun, 12 Jul 2026 08:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783868797; x=1784473597; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=88hvktTu0KZHeu02mXoEzw2BIFJy4M/j3xm/aWChyjQ=; b=GGVCSkl1iGhre0LanqXjUQLSXeeSZ47ziUm1Mfc1ODBR+Bw+jbINzBl/Nch03A42A1 +YaeGbkBkBvQbBE0ef9aNxdnomfMzqLt6yoe8PlqOQnol03jAn9VkYHwUdVvBDTRwt5u bu1pQVWdZ16FKFY30xAgPKIv4W8mkUOZH4emMXLANTav5FyL5QtuOExZ47D65CJD9Yr/ H140ELoyRi6eKR8JDtVEflN+8wK/hTorxLs7XZkjiDndK1queAfZ2+MeTDefuDj+fj1U FMzoIqqSTR05/VuHzFrFSy4A04ef0PjlNj9iXendPzJX+auiPns0rLwl4FToTCXGTZXZ rHQg== X-Forwarded-Encrypted: i=1; AFNElJ9MbHRhOcYdWsIQ+oJijtW4F3ew3Cq4KQs5yuC2hLCOqp33lfFtbbEnbwzjKmbH608CpPLruje/flvKk6E=@vger.kernel.org X-Gm-Message-State: AOJu0YzflYSyrJs/qfAvUVLKnC2S0lWAJFVQcxwMGRNC69R/GrF6r+ED JFhEgBsdqSuv34GjZJ2Y414+RiNSpO99Q1arjx+D3GAUAbF2mbDEmxWpEZqDdA== X-Gm-Gg: AfdE7clcAkPiYJPcgbDgheB5XeNiBcaP9rSbhAnwtJc6gIBgJROwPy6nZelg8skOKKf n/fKaW/ykm3sz7lzA2WsFwus9CnLLo+F05DjK7FeQsgkeFyZrDOFwropZ0R3fgo182+I3241Y5v qfeL6kDiuXk8YZpJvExRNzNjucFWpHC5D9SVa+hMbHyyQm6GRQmhZ8m1jaj/ryTN2x5wCBlA/A/ O5ScWmghU5MoGKwBkb5jxGNjV6wpY5Gj4hiPAVJcC2XM/8hyGoZaHdV244UXCwOJAch3FabnRyw xFj6UnkS9lSJ5fcm1gHm8YdgT9U+VZop5oy7vLxuloHIPWRL79deF0UEG+fsP6SK+nQvewqtRNv L4ImJd6JnbxOzT1PsjSQZc8cQadCtxkJd3KuvbV7haAee3AOvaWS1ulmdZsKzlhTh3HxCybCzxm DbgPCQ3+aUXet0zZr6WWX1RMZYIOP+0IS9Ab2RbgWKjt85jdzRfgPDPK5MuBBJ0DyfD2BV8+yIo zFK4nbge4xtEVCr1576JGEOc8QMd86GPgXmBkSVlruzF61T8bv28iArDQwjyg8= X-Received: by 2002:a05:6820:f003:b0:6a1:7bd2:744b with SMTP id 006d021491bc7-6a39a6a89d2mr3394213eaf.38.1783868797216; Sun, 12 Jul 2026 08:06:37 -0700 (PDT) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com. [209.85.210.49]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6a36a83eb2dsm9897957eaf.10.2026.07.12.08.06.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Jul 2026 08:06:36 -0700 (PDT) Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-7eb545db3afso1417370a34.0 for ; Sun, 12 Jul 2026 08:06:36 -0700 (PDT) X-Forwarded-Encrypted: i=1; AFNElJ9x/A1xV9iob1HMS8hHUobHxW3UiQlS54Q3pfaCWIES9/VAAOYVOVlU4HjNTsBYpz7OdH09dGKnboelm78=@vger.kernel.org X-Received: by 2002:a05:6830:81f3:b0:7e3:d199:3164 with SMTP id 46e09a7af769-7ec096ee194mr3373053a34.11.1783868796457; Sun, 12 Jul 2026 08:06:36 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260712-reflink-into-nodatasum-v1-0-9f27ef836073@amutable.com> In-Reply-To: <20260712-reflink-into-nodatasum-v1-0-9f27ef836073@amutable.com> From: Neal Gompa Date: Sun, 12 Jul 2026 11:06:00 -0400 X-Gmail-Original-Message-ID: X-Gm-Features: AVVi8Cd2-p1zTlGWQGpQGZf-1g42rHsDM1sB7d20uoAFfIyhS_ZBfMdr40Cq_aI Message-ID: Subject: Re: [PATCH 0/2] btrfs: allow reflinks into NODATASUM files To: daan@amutable.com Cc: Chris Mason , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jul 12, 2026 at 10:25=E2=80=AFAM Daan De Meyer via B4 Relay wrote: > > The primary use case for this series is building a NOCOW VM image from > individual partition images that are COW and checksummed. Today those > partitions cannot be cloned into the NODATACOW and NODATASUM destination, > so tools fall back to a full copy. This makes provisioning slower and > duplicates all of the image data up front. > > Allow cloning and deduplication from a checksummed file into a NODATASUM > file. The VM image can then share extents with the partition images. > Existing checksummed extents are COWed once when modified, protecting the > source checksums, while newly allocated extents use the destination's > normal NOCOW behavior. > > The reverse direction remains rejected because the destination would > expect checksums that do not exist. > > Patch 1 prevents swap activation from bypassing the COW protection when a > NODATASUM file references checksummed extents. Patch 2 relaxes the reflin= k > restriction in the safe direction. > > The xfstests branch is available at: > https://github.com/kdave/xfstests/pull/6 > > Signed-off-by: Daan De Meyer > --- > Daan De Meyer (2): > btrfs: reject swapfile activation if any extent has checksums > btrfs: allow reflinking from checksummed files into nodatasum files > > fs/btrfs/inode.c | 29 +++++++++++++++++++++++++++++ > fs/btrfs/reflink.c | 18 ++++++++++++++---- > 2 files changed, 43 insertions(+), 4 deletions(-) > --- > base-commit: cab9e339cfbc1a4e075e53e281dfb00391e1a6bb > change-id: 20260712-reflink-into-nodatasum-aff962f3794e > The patch series looks good to me. Reviewed-by: Neal Gompa That said, I have a question: Is there no reason we couldn't reflink into a checksummed area and generate *new* checksums for that purpose? That would be useful for staging for regular backup. I can foresee that being useful for archiving OS trees or VM images as snapshots by creating checksums for the newly created snapshots... -- =E7=9C=9F=E5=AE=9F=E3=81=AF=E3=81=84=E3=81=A4=E3=82=82=E4=B8=80=E3=81=A4=EF= =BC=81/ Always, there's only one truth!