[dm-devel] [PATCH v2] dm-integrity: if we have discard support, use it when recalculating

Mikulas Patocka mpatocka at redhat.com
Wed May 5 20:05:35 UTC 2021



On Wed, 5 May 2021, Melvin Vermeeren wrote:

> Hi,
> 
> On Wednesday, 5 May 2021 20:48:47 CEST Mikulas Patocka wrote:
> > It doesn't matter if the device is discarded or not. If the metadata
> > constains the discard filler, dm-integrity won't check the checksum - so
> > the data can contain anything.
> > 
> > ...
> >
> > The device after discard may contain random pattern (some SSDs really do)
> > - so when the metadata contains the discard filler, the data may contain
> > anything.
> 
> So if an existing SSD is formatted with --no-wipe --data-device option and 
> then opened with --integrity-recalculate all metadata will contain the discard 
> filler with this patch.
> 
> So then, all the current data in the drive is not checked for integrity 
> because it contains discard filler. This means that integrity recalculation 
> itself never takes place for existing data. Meaning that only newly written 
> data to SSD device will actually have integrity protection.
> 
> Is this correct?

Yes.

Mikulas

> Cheers,
> 
> -- 
> Melvin Vermeeren
> Systems engineer




More information about the dm-devel mailing list