FreeBSD: Add option to rewind checkpoint while importing root pool

This option is used by FreeBSD boot loader.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mariusz Zaborski <oshogbo@vexillium.org>
Closes #10738
This commit is contained in:
Mariusz Zaborski
2020-08-20 02:19:42 +02:00
committed by GitHub
parent 5266a0728a
commit f2c027bd6a
3 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -185,7 +185,7 @@ spa_generate_rootconf(const char *name)
}
int
spa_import_rootpool(const char *name)
spa_import_rootpool(const char *name, bool checkpointrewind)
{
spa_t *spa;
vdev_t *rvd;
@@ -244,6 +244,9 @@ spa_import_rootpool(const char *name)
}
spa->spa_is_root = B_TRUE;
spa->spa_import_flags = ZFS_IMPORT_VERBATIM;
if (checkpointrewind) {
spa->spa_import_flags |= ZFS_IMPORT_CHECKPOINT;
}
/*
* Build up a vdev tree based on the boot device's label config.
+1 -1
View File
@@ -1580,7 +1580,7 @@ zfs_mount(vfs_t *vfsp)
error = getpoolname(osname, pname);
if (error == 0)
error = spa_import_rootpool(pname);
error = spa_import_rootpool(pname, false);
if (error)
goto out;
}