On Tue, 20 Sep 2022, Christoph Hellwig wrote:
> On Fri, Sep 16, 2022 at 05:00:46AM -0400, Mikulas Patocka wrote:
> > This patch implements REQ_OP_SECURE_ERASE and REQ_OP_WRITE_ZEROES on brd.
> > Write zeroes will free the pages just like discard, but the difference is
> > that it writes zeroes to the preceding and following page if the range is
> > not aligned on page boundary. Secure erase is just like write zeroes,
> > except that it clears the page content before freeing the page.
>
> What is the use case of this? And just a single overwrite is not what
> storage standards would consider a secure erase, but then again we
> don't really have any documentation or standards for the Linux OP,
> which strongly suggests not actually implementing it for now.
Without support for REQ_OP_WRITE_ZEROES, "blkdiscard -z" actually
overwrites the ramdisk with zeroes and allocates all the blocks.
Allocating all the blocks is pointless if we want to clear them.
I implemented REQ_OP_SECURE_ERASE just because it is similar to
REQ_OP_WRITE_ZEROES. Unlike disks, DRAM has no memory of previous content,
so a single overwrite should be OK. We could also flush cache in
REQ_OP_SECURE_ERASE, but I don't know if Linux has any portable function
that does it.
Mikulas
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel