Page MenuHomeFreeBSD

Prevent ZFS TRIM breaking VTOC8 partitions
ClosedPublic

Authored by smh on Mar 14 2018, 5:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 15 2024, 11:20 AM
Unknown Object (File)
Dec 20 2023, 3:21 AM
Unknown Object (File)
Nov 21 2023, 5:38 AM
Unknown Object (File)
Nov 21 2023, 5:36 AM
Unknown Object (File)
Nov 21 2023, 4:40 AM
Unknown Object (File)
Nov 9 2023, 4:12 AM
Unknown Object (File)
Aug 30 2023, 3:05 AM
Unknown Object (File)
Aug 28 2023, 11:47 PM
Subscribers

Details

Reviewers
marius
avg
Summary

Update the ZFS TRIM code to ensure it respects VTOC8 partition headers as documented by the ZFS On-Disk Specification section 1.3

Before this a zpool create on a VTOC8 partitioned device would overwrite the partition metadata.

Test Plan

Create a VTOC8 parition on a md device followed by creating a ZFS pool and ensure it doesn't remove the partition metadata.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 15568
Build 15605: arc lint + arc unit

Event Timeline

smh retitled this revision from Prevent ZFS TRIM breakng VTOC8 partitions to Prevent ZFS TRIM breaking VTOC8 partitions.Mar 14 2018, 5:41 PM
smh edited the summary of this revision. (Show Details)
smh edited the test plan for this revision. (Show Details)
smh added reviewers: marius, avg.
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c
816

I'd have expected the size to be trimmed as well... or is this a start block to end block API

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c
816

No, it's start plus size.
Good catch.

Correct size argument as zio_trim is offset + size not start + end.

smh marked 2 inline comments as done.Mar 14 2018, 8:37 PM
This revision is now accepted and ready to land.Mar 14 2018, 9:00 PM

This looks good to me, I'm still somewhat puzzled, though, as to why the problem has only be encountered with md(4) devices. Was that simply due to the fact that we happened to test with disks that DISKFLAG_CANDELETE doesn't get set for?

Its only a problem for devices that report they support TRIM so it wouldn't impact HDD's but would effect SSD's or MD devices.