[pve-devel] [PATCH V3 pve-storage] lvm: use blkdiscard instead cstream to saferemove drive

DERUMIER, Alexandre alexandre.derumier at groupe-cyllene.com
Mon Oct 20 09:56:16 CEST 2025


Hi Fiona, I'm going to fix all your comment for this patch


> +                my $write_zeroes_max_bytes =
> +                   
> file_read_firstline("$sysdir/queue/write_zeroes_max_bytes") // 0;

>>According to the docs: "The value 0 means that REQ_OP_WRITE_ZEROES
>>is not supported.", so it makes sense as a fallback too. But do we
>>need
>>to handle that somehow below, i.e. can --zeroout still be used if the
>>reported value is 0? Or do we need to fall back to the old way of
>>doing it?

I don't have read the code of blkdiscard yet (and don't have found
device without write zeroes support to test), but according to redhat
doc
https://www.ovirt.org/develop/release-management/features/storage/wipe-volumes-using-blkdiscard.html

"There are no restrictions when using blkdiscard -z, although
blkdiscard performs roughly the same as dd if the storage does not
support write same."



More information about the pve-devel mailing list