mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Yu Kuai <yukuai1@huaweicloud.com>,
	Alasdair Kergon <agk@redhat.com>,
	 Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	dm-devel@lists.linux.dev, lkml <linux-kernel@vger.kernel.org>,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [discussion] proposal to bypass zero data for dm-crypt
Date: Mon, 06 Jan 2025 18:04:54 -0800	[thread overview]
Message-ID: <cb49d8ca786fd0e51947e83e74036a6c00f75e2e.camel@HansenPartnership.com> (raw)
In-Reply-To: <73152f2b-2a3e-37a7-4578-9a4ae7ec903f@huaweicloud.com>

On Sat, 2024-12-21 at 10:34 +0800, Yu Kuai wrote:
> Background
> 
> We provide virtual machines for customers to use, which include an 
> important feature: in the initial state, the disks in the virtual 
> machine do not occupy actual storage space, and the data read by
> users is all zeros until the user writes data for the first time.
> This can save a large amount of storage.
> 
> Problem
> 
> However, after introducing dm-crypt, this feature has failed. Because
> we expect the data read by users in the initial state to be zero, we
> have to write all zeros from dm-crypt.

Why do you expect the user to read all zeros?  For DM crypt on a new
physical disk, we don't set the disk contents to an initial value
because there's no expectation on the part of the user that they can
read a sector they haven't written and get a sensible result instead of
the dm-crypt of whatever the sector contained.  Why can't your cloud
system just behave like a physical disk?

Even for an unencrypted physical disk, there's no expectation of any
particular value being in a sector, so why do your users have the
expectation of all zeros?

Regards,

James


      parent reply	other threads:[~2025-01-07  2:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-21  2:34 Yu Kuai
2025-01-03 16:25 ` Mikulas Patocka
2025-01-05 20:54   ` Milan Broz
2025-01-06  1:43     ` Yu Kuai
2025-01-06  9:09       ` Milan Broz
2025-01-06  9:39         ` Yu Kuai
2025-01-07  2:04 ` James Bottomley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb49d8ca786fd0e51947e83e74036a6c00f75e2e.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®