Page MenuHomeFreeBSD

zfs: cleanup metaslabs across txgs
AbandonedPublic

Authored by nick_spun.io on Sat, Jun 20, 9:35 PM.

Details

Reviewers
None
Summary

On a read-write import, metaslab_set_fragmentation() can dirty a metaslab via vdev_dirty() while still in the txg==0 load path when its space map has an unexpected bonus size (e.g. a makefs-created pool whose space-map dnodes use the boot loader's 24-byte space_map_phys_t with nblkptr=3, giving db_size=64). If that metaslab is then selected as the embedded slog, vdev_metaslab_init() only removed it from vdev_ms_list when txg != 0, so the txg==0 case left it queued and metaslab_fini() tripped VERIFY(!txg_list_member(&vd->vdev_ms_list, msp, t)).

Remove slog_ms from the dirty list for every TXG_SIZE slot before metaslab_fini() so the cleanup is correct regardless of txg.

PR: 281520

Upstreamed at https://github.com/openzfs/zfs/commit/0483a8e0c0cb28cc215dfafaa2ff1d79f5bd1860

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74075
Build 70958: arc lint + arc unit