aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/module/os
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/module/os')
-rw-r--r--sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
index 7bc6b83d0272..a537342f9678 100644
--- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
+++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
@@ -1291,6 +1291,18 @@ getpoolname(const char *osname, char *poolname)
return (0);
}
+static void
+fetch_osname_options(char *name, bool *checkpointrewind)
+{
+
+ if (name[0] == '!') {
+ *checkpointrewind = true;
+ memmove(name, name + 1, strlen(name));
+ } else {
+ *checkpointrewind = false;
+ }
+}
+
/*ARGSUSED*/
static int
zfs_mount(vfs_t *vfsp)
@@ -1301,6 +1313,7 @@ zfs_mount(vfs_t *vfsp)
char *osname;
int error = 0;
int canwrite;
+ bool checkpointrewind;
if (vfs_getopt(vfsp->mnt_optnew, "from", (void **)&osname, NULL))
return (SET_ERROR(EINVAL));
@@ -1314,6 +1327,8 @@ zfs_mount(vfs_t *vfsp)
secpolicy_fs_mount_clearopts(cr, vfsp);
}
+ fetch_osname_options(osname, &checkpointrewind);
+
/*
* Check for mount privilege?
*
@@ -1392,7 +1407,7 @@ zfs_mount(vfs_t *vfsp)
error = getpoolname(osname, pname);
if (error == 0)
- error = spa_import_rootpool(pname, false);
+ error = spa_import_rootpool(pname, checkpointrewind);
if (error)
goto out;
}