freebsd-dev/cddl
Mariusz Zaborski 23ee238fe5 zfs: Add option for forcible unmounting dataset while receiving snapshot.
Currently when the dataset is in use we can't receive snapshots.

zfs send test/1@asd | zfs recv -FM test/2
cannot unmount '/test/2': Device busy

This commits add option 'M' which attempts to forcibly unmount the
dataset.  Thanks to this we can enforce receiving snapshots in a
single step.

Note that this functionality is not supported on Linux because the
VFS will prevent active mounted filesystems from being unmounted,
even with the force option.  This is the intended VFS behavior.

Discussed-with: Pawel Jakub Dawidek <pjd@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Allan Jude <allanjude@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D22306

openzfs/zfs@a57d3d45d6
2020-04-11 17:54:35 +00:00
..
compat/opensolaris Honor all options of "zfs mount -o" 2017-09-05 19:28:35 +00:00
contrib/opensolaris zfs: Add option for forcible unmounting dataset while receiving snapshot. 2020-04-11 17:54:35 +00:00
lib sack_newdata and snd_recover hold the same value. Therefore, use only 2020-02-13 15:14:46 +00:00
sbin pkgbase: Force zfs(8) and zpool(8) to be in the runtime package 2019-09-05 14:07:49 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
usr.bin fix up r354804, link zstreamdump with libzfs 2019-11-18 10:34:27 +00:00
usr.sbin DTrace: add a top level makefile to the new test suit 2019-06-09 22:45:07 +00:00
Makefile Convert traditional ${MK_TESTS} conditional idiom for including test 2017-08-02 08:35:51 +00:00
Makefile.inc Make DTrace stuff compile with C99 standard. 2014-08-22 20:04:51 +00:00