git: 7edc1bd9dc17 - main - When be_activate() turns on a new boot environment, it always deactivates the current one first. And if it fails to do so, it abandons activation. However, with the new bootonce feature, there is a legitimate case when a pool doesn't have "bootfs" property set. Check for this case before calling be_deactivate().
Gleb Smirnoff
glebius at FreeBSD.org
Fri Jan 8 17:26:15 UTC 2021
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=7edc1bd9dc174526c69246ba45bf2c8c230d38f4
commit 7edc1bd9dc174526c69246ba45bf2c8c230d38f4
Author: Gleb Smirnoff <glebius at FreeBSD.org>
AuthorDate: 2021-01-08 17:23:16 +0000
Commit: Gleb Smirnoff <glebius at FreeBSD.org>
CommitDate: 2021-01-08 17:23:16 +0000
When be_activate() turns on a new boot environment, it always deactivates
the current one first. And if it fails to do so, it abandons activation.
However, with the new bootonce feature, there is a legitimate case when
a pool doesn't have "bootfs" property set. Check for this case before
calling be_deactivate().
Reviewed by: kevans
---
lib/libbe/be.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/libbe/be.c b/lib/libbe/be.c
index 644cf90a6fd7..d6fe027f5df3 100644
--- a/lib/libbe/be.c
+++ b/lib/libbe/be.c
@@ -1263,7 +1263,8 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary)
return (lzbe_set_boot_device(
zpool_get_name(lbh->active_phandle), lzbe_add, be_path));
} else {
- if (be_deactivate(lbh, lbh->bootfs, false) != 0)
+ if (strncmp(lbh->bootfs, "-", 1) != 0 &&
+ be_deactivate(lbh, lbh->bootfs, false) != 0)
return (-1);
/* Obtain bootenv zpool */
More information about the dev-commits-src-all
mailing list