Is there any error checking on swap?

Xin Li delphij at delphij.net
Sun Jul 12 22:06:57 UTC 2020



On 7/12/20 12:29 AM, John-Mark Gurney wrote:
> bob prohaska wrote this message on Sat, Jul 11, 2020 at 20:33 -0700:
>> Is there any error checking on swap traffic, along the lines of
>> a checksum or parity test? 
>>
>> Just curious what happens if a page written out is corrupted  when
>> it comes back.
> 
> Looks like it doesn't:
> https://svnweb.freebsd.org/base/head/sys/vm/swap_pager.c?annotate=361965#l1389

Technically one can enable checks with e.g. geli(8), but note that the
geli(8) provider will not "prime" the HMAC data so attaching the device
will immediately spam the system log with some authentication errors due
to GEOM tasting (because the kernel would try to read locations that
potentially contain metadata for other GEOM providers).

For the case of swap, since the write is always page sized, it's
probably optimal to implement something in the swap layer itself and
store the expected checksums in memory.

Cheers,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 866 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20200712/5267fda4/attachment.sig>


More information about the freebsd-current mailing list