zfs/man/man8
Mariusz Zaborski 40a9efd0e8 zfs: support force exporting pools
This is primarily of use when a pool has lost its disk, while the user
doesn't care about any pending (or otherwise) transactions.

Implement various control methods to make this feasible:
- txg_wait can now take a NOSUSPEND flag, in which case the caller will
  be alerted if their txg can't be committed.  This is primarily of
  interest for callers that would normally pass TXG_WAIT, but don't want
  to wait if the pool becomes suspended, which allows unwinding in some
  cases, specifically when one is attempting a non-forced export.
  Without this, the non-forced export would preclude a forced export
  by virtue of holding the namespace lock indefinitely.
- txg_wait also returns failure for TXG_WAIT users if a pool is actually
  being force exported.  Adjust most callers to tolerate this.
- spa_config_enter_flags now takes a NOSUSPEND flag to the same effect.
- DMU objset initiator which may be set on an objset being forcibly
  exported / unmounted.
- SPA export initiator may be set on a pool being forcibly exported.
- DMU send/recv now use an interruption mechanism which relies on the
  SPA export initiator being able to enumerate datasets and closing any
  send/recv streams, causing their EINTR paths to be invoked.
- ZIO now has a cancel entry point, which tells all suspended zios to
  fail, and which suppresses the failures for non-CANFAIL users.
- metaslab, etc. cleanup, which consists of simply throwing away any
  changes that were not able to be synced out.
- Linux specific: introduce a new tunable,
  zfs_forced_export_unmount_enabled, which allows the filesystem to
  remain in a modified 'unmounted' state upon exiting zpl_umount_begin,
  to achieve parity with FreeBSD and illumos,
  which have VFS-level support for yanking filesystems out from under
  users.  However, this only helps when the user is actively performing
  I/O, while not sitting on the filesystem.  In particular, this allows
  test #3 below to pass on Linux.
- Add basic logic to zpool to indicate a force-exporting pool, instead
  of crashing due to lack of config, etc.

Add tests which cover the basic use cases:
- Force export while a send is in progress
- Force export while a recv is in progress
- Force export while POSIX I/O is in progress

This change modifies the libzfs ABI:
- New ZPOOL_STATUS_FORCE_EXPORTING zpool_status_t enum value.
- New field libzfs_force_export for libzfs_handle.

Signed-off-by: Will Andrews <will@firepipe.net>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Signed-off-by: Mariusz Zaborski <mariusz.zaborski@klarasystems.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by:  Klara, Inc.
Sponsored-by:  Catalogics, Inc.
Sponsored-by:  Wasabi Technology, Inc.
Closes #3461
(cherry picked from commit 852e633772217d779a63e8c46fe3c5f81dd8960e)
2023-07-05 13:27:30 +00:00
..
.gitignore Ignore *.o.ur-safe build artifacts 2018-05-13 18:59:02 -07:00
fsck.zfs.8 Consistentify miscellaneous style on remaining manpages 2021-06-10 10:50:16 -07:00
mount.zfs.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
vdev_id.8 vdev_id.8: modernise, note scsi topology 2021-06-09 13:05:34 -07:00
zdb.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zed.8.in Consistentify miscellaneous style on remaining manpages 2021-06-10 10:50:16 -07:00
zfs-allow.8 Add missing properties to zfs allow manpage 2021-09-14 13:08:19 -07:00
zfs-bookmark.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-change-key.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-clone.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-create.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-destroy.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zfs-diff.8 zfs, libzfs: diff: accept -h/ZFS_DIFF_NO_MANGLE, disabling path escaping 2022-04-01 09:58:45 -07: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 Lint most manpages 2021-06-09 13:05:34 -07:00
zfs-inherit.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-jail.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-list.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-load-key.8 man: speling 2022-02-16 17:58:55 -08:00
zfs-mount-generator.8.in etc/systemd/zfs-mount-generator: serialise, handle keylocation=http[s]:// 2022-04-01 09:58:45 -07:00
zfs-mount.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-program.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zfs-project.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zfs-projectspace.8 Reorganize zfs(8) man page into sections 2019-11-12 11:17:40 -08:00
zfs-promote.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zfs-receive.8 zfs-receive.8: properly unlight = in option setting 2022-02-16 17:58:56 -08: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 Lint most manpages 2021-06-09 13:05:34 -07:00
zfs-rollback.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zfs-send.8 Correct zfs-send(8) on readonly sends 2021-09-14 12:38:51 -07:00
zfs-set.8 Document zfs inherit -S's interaction with noninheritable properties 2022-04-21 11:09:35 -07:00
zfs-share.8 zfs-share.8: document -l flag 2022-02-16 17:58:55 -08:00
zfs-snapshot.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07: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 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-userspace.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs-wait.8 Modernise/fix/rewrite unlinted manpages 2021-06-09 13:05:34 -07:00
zfs.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zfs_ids_to_path.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zgenhostid.8 man: speling 2022-02-16 17:58:55 -08:00
zinject.8 zinject.8: modernise 2021-06-09 13:05:34 -07:00
zpool-add.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-attach.8 man: speling 2022-02-16 17:58:55 -08:00
zpool-checkpoint.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool-clear.8 Clarify `failmode=wait` documentation 2022-02-16 17:58:55 -08:00
zpool-create.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-destroy.8 Modernise/fix/rewrite unlinted manpages 2021-06-09 13:05:34 -07:00
zpool-detach.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool-events.8 man: speling 2022-02-16 17:58:55 -08:00
zpool-export.8 zfs: support force exporting pools 2023-07-05 13:27:30 +00:00
zpool-get.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-history.8 Modernise/fix/rewrite unlinted manpages 2021-06-09 13:05:34 -07:00
zpool-import.8 man: zpool-import.8: -d -or -c 2022-05-10 13:36:37 -07:00
zpool-initialize.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool-iostat.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool-labelclear.8 Modernise/fix/rewrite unlinted manpages 2021-06-09 13:05:34 -07:00
zpool-list.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-offline.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool-online.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-reguid.8 Modernise/fix/rewrite unlinted manpages 2021-06-09 13:05:34 -07:00
zpool-remove.8 zpool-remove.8: describe top-level vdev sector size limitation 2021-09-14 14:32:16 -07:00
zpool-reopen.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool-replace.8 man: speling 2022-02-16 17:58:55 -08:00
zpool-resilver.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool-scrub.8 systemd: add weekly and monthly scrub timers 2022-02-10 11:04:35 -08:00
zpool-set.8 Reorganize zpool(8) man page into sections 2019-11-13 09:21:07 -08:00
zpool-split.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-status.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-sync.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-trim.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-upgrade.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool-wait.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zpool.8 Move properties, parameters, events, and concepts around manual sections 2021-06-10 10:50:16 -07:00
zpool_influxdb.8 Consistentify miscellaneous style on remaining manpages 2021-06-10 10:50:16 -07:00
zstream.8 Lint most manpages 2021-06-09 13:05:34 -07:00
zstreamdump.8 zstreamdump: replace with link to zstream 2021-06-08 14:48:58 -07:00