summaryrefslogtreecommitdiffstats
path: root/include/libzfs.h
diff options
context:
space:
mode:
authorMariusz Zaborski <[email protected]>2020-03-17 18:08:32 +0100
committerGitHub <[email protected]>2020-03-17 10:08:32 -0700
commita57d3d45d6efdff935421e2ef3f97e3dc089d93d (patch)
treedac886a88e2c50cd450f1684f93d8549e24469e9 /include/libzfs.h
parent80d98a8f3addfbfa1feefef70774193ed18c1013 (diff)
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. Test cases were added to verify the expected behavior based on the platform. Discussed-with: Pawel Jakub Dawidek <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Allan Jude <[email protected]> External-issue: https://reviews.freebsd.org/D22306 Closes #9904
Diffstat (limited to 'include/libzfs.h')
-rw-r--r--include/libzfs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 7f728e3a5..236a73130 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -758,6 +758,9 @@ typedef struct recvflags {
/* mount the filesystem unless nomount is specified */
boolean_t domount;
+
+ /* force unmount while recv snapshot (private) */
+ boolean_t forceunmount;
} recvflags_t;
extern int zfs_receive(libzfs_handle_t *, const char *, nvlist_t *,