all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Lukas Sichert" <l.sichert@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH storage v11 2/6] lvm: saferemove: zero out volumes range by range
Date: Wed, 29 Jul 2026 17:34:24 +0200	[thread overview]
Message-ID: <DKB5Y7B5TUXI.3TC09EL2TLVCZ@proxmox.com> (raw)
In-Reply-To: <20260723135656.102972-3-l.sichert@proxmox.com>

On Thu Jul 23, 2026 at 3:56 PM CEST, Lukas Sichert wrote:

[snip]

> +                } elsif ($zeroout_variant eq 'syswrite') {
> +
> +                    # allow retrying once if syswrite writes zero bytes
> +                    $written = syswrite($fh, $zeroes, $stepsize, 0);
> +                    if (!defined($written)) {
> +                        die "syswrite failed: $!\n";
> +                    } elsif ($written == 0) {
> +                        warn "syswrite wrote 0 bytes, retrying";
> +                    }
> +
> +                    while ($written < $stepsize) {
> +                        my $remaining = $stepsize - $written;
> +                        my $retried_write = syswrite($fh, $zeroes, $remaining, $written);
> +                        if (!defined($retried_write)) {
> +                            die "syswrite failed: $!\n";
> +                        } elsif ($retried_write == 0) {
> +                            die "syswrite failed: wrote 0 bytes";
> +                        }
> +                        $written += $retried_write;
> +                    }

How do we ensure here that all data is actually zeroed out on disk as
well? Do we flush to disk in some way? Because if not, this might run,
then immediately discard and not all data might have been zeroed out.
Perhaps fsync? I think in Perl there'd be $fh->sync. Or am I missing
something here and this is already guaranteed to happen?

> +
> +                }
> +                $written_total += $written;
> +
> +                my $curr_time = clock_gettime(CLOCK_MONOTONIC);
> +                if (($curr_time - $lastprint) >= 3) {
> +                    my $percent_finished = 100 * $written_total / $size;

[snip]




  reply	other threads:[~2026-07-29 15:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 13:56 [PATCH docs/manager/storage v11 0/6] fix #7339: lvmthick: add option to free storage for deleted VMs Lukas Sichert
2026-07-23 13:56 ` [PATCH storage v11 1/6] lvm: saferemove: keep LVs where zero-out failed for manual zero-out Lukas Sichert
2026-07-23 13:56 ` [PATCH storage v11 2/6] lvm: saferemove: zero out volumes range by range Lukas Sichert
2026-07-29 15:34   ` Michael Köppl [this message]
2026-07-23 13:56 ` [PATCH storage v11 3/6] lvm: saferemove: make throughput an integer property Lukas Sichert
2026-07-23 13:56 ` [PATCH storage v11 4/6] fix #7339: lvm: add discard action for removed volumes Lukas Sichert
2026-07-29 15:12   ` Michael Köppl
2026-07-23 13:56 ` [PATCH manager v11 5/6] fix #7339: lvm: add discard-on-remove option to UI Lukas Sichert
2026-07-30 14:36   ` Michael Köppl
2026-07-23 13:56 ` [PATCH docs v11 6/6] fix #7339: lvm: document discard option Lukas Sichert
2026-07-30 14:34 ` [PATCH docs/manager/storage v11 0/6] fix #7339: lvmthick: add option to free storage for deleted VMs Michael Köppl

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=DKB5Y7B5TUXI.3TC09EL2TLVCZ@proxmox.com \
    --to=m.koeppl@proxmox.com \
    --cc=l.sichert@proxmox.com \
    --cc=pve-devel@lists.proxmox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal