freebsd-dev/module
Andriy Gapon 8ca78ab002 OpenZFS 7600 - zfs rollback should pass target snapshot to kernel
Authored by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>

The existing kernel-side code only provides a method to rollback to a
latest snapshot, whatever it happens to be at the time when the rollback
is actually done.  That could be unsafe or confusing in environments
where concurrent DSL changes are possible as the resulting state could
correspond to a newer or older snapshot than the originally requested
one.
This change allows to amend that method such that the rollback is
performed only when the latest snapshot has a specific name.  That is,
if a new snapshot is concurrently created or the target snapshot is
destroyed, then no rollback is done and EXDEV error is returned.
New libzfs_core function lzc_rollback_to() is provided for the new
functionality.  libzfs is changed to use lzc_rollback_to() to implement
zfs rollback command.
Perhaps we should return different errors to distinguish the case where
the desired snapshot exists but it's not the latest snapshot and the
case where the desired snapshot does not exist.

OpenZFS-issue: https://www.illumos.org/issues/7600
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/3d645eb
Closes #6292
2017-07-04 15:29:52 -07:00
..
avl Fix uninitialized variable in avl_add() 2016-07-25 14:21:34 -07:00
icp Add kpreempt_disable/enable around CPU_SEQID uses 2017-06-19 09:43:16 -07:00
nvpair OpenZFS 7812 - Remove gender specific language 2017-02-24 11:07:04 -08:00
unicode codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zcommon Make createtxg and guid properties public 2017-05-09 15:36:53 -07:00
zfs OpenZFS 7600 - zfs rollback should pass target snapshot to kernel 2017-07-04 15:29:52 -07:00
zpios codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
.gitignore Improve gitignore 2017-05-25 10:14:13 -07:00
Makefile.in GZIP compression offloading with QAT accelerator 2017-03-22 17:58:47 -07:00