mirror_zfs/man/man8
Matthew Ahrens 6774931dfa
Extend zdb to print inconsistencies in livelists and metaslabs
Livelists and spacemaps are data structures that are logs of allocations
and frees.  Livelists entries are block pointers (blkptr_t). Spacemaps
entries are ranges of numbers, most often used as to track
allocated/freed regions of metaslabs/vdevs.

These data structures can become self-inconsistent, for example if a
block or range can be "double allocated" (two allocation records without
an intervening free) or "double freed" (two free records without an
intervening allocation).

ZDB (as well as zfs running in the kernel) can detect these
inconsistencies when loading livelists and metaslab.  However, it
generally halts processing when the error is detected.

When analyzing an on-disk problem, we often want to know the entire set
of inconsistencies, which is not possible with the current behavior.
This commit adds a new flag, `zdb -y`, which analyzes the livelist and
metaslab data structures and displays all of their inconsistencies.
Note that this is different from the leak detection performed by
`zdb -b`, which checks for inconsistencies between the spacemaps and the
tree of block pointers, but assumes the spacemaps are self-consistent.

The specific checks added are:

Verify livelists by iterating through each sublivelists and:
- report leftover FREEs
- report double ALLOCs and double FREEs
- record leftover ALLOCs together with their TXG [see Cross Check]

Verify spacemaps by iterating over each metaslab and:
- iterate over spacemap and then the metaslab's entries in the
  spacemap log, then report any double FREEs and double ALLOCs

Verify that livelists are consistenet with spacemaps.  The space
referenced by livelists (after using the FREE's to cancel out
corresponding ALLOCs) should be allocated, according to the spacemaps.

Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Sara Hartse <sara.hartse@delphix.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
External-issue: DLPX-66031
Closes #10515
2020-07-14 17:51:05 -07:00
..
.gitignore Ignore *.o.ur-safe build artifacts 2018-05-13 18:59:02 -07:00
fsck.zfs.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
Makefile.am Centralize variable substitution 2020-07-14 17:33:44 -07:00
mount.zfs.8 zfs.8 & mount.zfs.8: fix a few typos 2016-05-16 12:26:31 -07:00
vdev_id.8 vdev_id support for device link aliases 2012-12-03 14:04:47 -08:00
zdb.8 Extend zdb to print inconsistencies in livelists and metaslabs 2020-07-14 17:51:05 -07:00
zed.8.in zed additional features 2020-06-22 09:53:34 -07:00
zfs_ids_to_path.8 Small program that converts a dataset id and an object id to a path 2020-05-20 10:05:33 -07:00
zfs-allow.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-bookmark.8 Implement bookmark copying 2020-02-11 13:19:12 -08:00
zfs-change-key.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-clone.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-create.8 zfs_create: round up volume size to multiple of bs 2020-04-24 19:04:34 -07:00
zfs-destroy.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-diff.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-get.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-groupspace.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-hold.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-inherit.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-jail.8 Add FreeBSD jail support hooks 2019-12-11 11:58:37 -08:00
zfs-list.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-load-key.8 Document zfs change-key caveats 2020-01-14 10:11:07 -08:00
zfs-mount-generator.8.in Systemd mount generator: Generate noauto units; add control properties 2020-02-14 15:32:55 -08:00
zfs-mount.8 Add notice that forcefully unmount is not supported on Linux 2020-02-18 13:36:23 -08:00
zfs-program.8 Support setting user properties in a channel program 2020-02-14 13:41:42 -08:00
zfs-project.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-projectspace.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-promote.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-receive.8 Remove deduplicated send/receive code 2020-04-23 10:06:57 -07:00
zfs-recv.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-redact.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-release.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-rename.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-rollback.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-send.8 Remove deduplicated send/receive code 2020-04-23 10:06:57 -07:00
zfs-set.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-share.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-snapshot.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-unallow.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-unjail.8 Add FreeBSD jail support hooks 2019-12-11 11:58:37 -08:00
zfs-unload-key.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-unmount.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-upgrade.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-userspace.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-wait.8 Add 'zfs wait' command 2020-04-01 10:02:06 -07:00
zfs.8 mount: use the mount syscall directly 2020-05-20 18:02:41 -07:00
zfsconcepts.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfsprops.8 man.8: Add bookmark to list of types 2020-06-10 17:53:07 -07:00
zgenhostid.8 Correct man page dates 2019-05-08 10:59:32 -07:00
zinject.8 Multiple DVA Scrubbing Fix 2019-03-15 14:14:31 -07:00
zpool-add.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-attach.8 Add device rebuild feature 2020-07-03 11:05:50 -07:00
zpool-checkpoint.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-clear.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-create.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-destroy.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-detach.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-events.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-export.8 Add notice that forcefully unmount is not supported on Linux 2020-02-18 13:36:23 -08:00
zpool-get.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-history.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-import.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-initialize.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-iostat.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-labelclear.8 Persistent L2ARC 2020-04-10 10:33:35 -07:00
zpool-list.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-offline.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-online.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-reguid.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-remove.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-reopen.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-replace.8 Add device rebuild feature 2020-07-03 11:05:50 -07:00
zpool-resilver.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-scrub.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-set.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-split.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-status.8 Add device rebuild feature 2020-07-03 11:05:50 -07:00
zpool-sync.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-trim.8 Add trim support to zpool wait 2020-03-04 15:07:11 -08:00
zpool-upgrade.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-wait.8 Add trim support to zpool wait 2020-03-04 15:07:11 -08:00
zpool.8 Remove unnecessary references to slavery 2020-06-10 17:07:59 -07:00
zpoolconcepts.8 Persistent L2ARC 2020-04-10 10:33:35 -07:00
zpoolprops.8 Trim L2ARC 2020-06-09 10:15:08 -07:00
zstream.8 Add zstream redup command to convert deduplicated send streams 2020-04-10 10:39:55 -07:00
zstreamdump.8 Eliminate useless double-bolding in man pages 2019-04-24 17:04:35 -07:00