HomeFreeBSD

swapon: Do not overwrite Linux swap header

Description

swapon: Do not overwrite Linux swap header

Reviewed by: imp, jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1084

Details

Provenance
rbranco_suse.comAuthored on Tue, Apr 23, 9:47 PM
impCommitted on Tue, Apr 23, 9:48 PM
Parents
rG4f223e0da7b4: release: Change vmimage EFI GPT label
Branches
Unknown
Tags
Unknown
Reverted By
rGfeabaf8d5389: Revert "swapon: Do not overwrite Linux swap header"

Event Timeline

I opened a new version at: https://github.com/freebsd/freebsd-src/pull/1205

I'm reading https://github.com/freebsd/freebsd-src/blob/main/sys/vm/swap_pager.c#L2432 right, FreeBSD already skips the first blocks to "avoid overwriting avoid overwriting any bsd label at the front of the partition". Much like NetBSD does.

The only difference in the new PR is s/4096/PAGE_SIZE to accomodate for other architectures (on Linux, x86_64 & s390x is 4096, ppc64le is 65536 & aarch64 is 16384).