Summary: | bectl: jail command does not mount deep boot environments | ||
---|---|---|---|
Product: | Base System | Reporter: | Wes Maag <jwmaag> |
Component: | bin | Assignee: | Kyle Evans <kevans> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | kevans |
Priority: | --- | Flags: | kevans:
mfc-stable12?
|
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any | ||
See Also: | https://reviews.freebsd.org/D18796 |
Description
Wes Maag
2019-01-09 18:03:01 UTC
Take A commit references this bug: Author: kevans Date: Thu Jan 10 03:27:21 UTC 2019 New revision: 342911 URL: https://svnweb.freebsd.org/changeset/base/342911 Log: libbe(3): Change be_mount to mount/unmount child datasets This set of changes is geared towards making bectl respect deep boot environments when they exist and are mounted. The deep BE composition functionality (`bectl add`) remains disabled for the time being. This set of changes has no effect for the average user. but allows deep BE users to upgrade properly with their current setup. libbe(3): Open the target boot environment and get a zfs handle, then pass that with the target mountpoint to be_mount_iter; If the BE_MNT_DEEP flag is set call zfs_iter_filesystems and mount the child datasets. Similar logic is employed when unmounting the datasets, save for children are unmounted first. bectl(8): Change bectl_cmd_jail to pass the BE_MNT_DEEP flag when calling be_mount as well as call be_unmount when cleaning up after the jail has exited instead of umount(2) directly. PR: 234795 Submitted by: Wes Maag <jwmaag_gmail.com> (test additions by kevans) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18796 Changes: head/lib/libbe/be_access.c head/sbin/bectl/bectl.c head/sbin/bectl/bectl_jail.c head/sbin/bectl/tests/bectl_test.sh Thanks! Will MFC to stable/12 in a week, then to stable/11 once the pending work on bectl/libbe slows down. A commit references this bug: Author: kevans Date: Mon Jan 21 02:57:59 UTC 2019 New revision: 343241 URL: https://svnweb.freebsd.org/changeset/base/343241 Log: MFC r342903, r342911: libbe(3)/bectl(8) refactor and fix mount for deep BEs r342903: libbe(3): move altroot augmentation bits around a little bit We could perhaps have a method that does this given a dataset, but it's yet clear that we'll always want to bypass the altroot when we grab the mountpoint. For now, we'll refactor things a bit so we grab the altroot length when libbe is initialized and have a common method that does the necessary augmentation (replace with / if it's the root, return a pointer to later in the string if not). This will be used in some upcoming work to make be_mount work properly for deep BEs. r342911: libbe(3): Change be_mount to mount/unmount child datasets This set of changes is geared towards making bectl respect deep boot environments when they exist and are mounted. The deep BE composition functionality (`bectl add`) remains disabled for the time being. This set of changes has no effect for the average user. but allows deep BE users to upgrade properly with their current setup. libbe(3): Open the target boot environment and get a zfs handle, then pass that with the target mountpoint to be_mount_iter; If the BE_MNT_DEEP flag is set call zfs_iter_filesystems and mount the child datasets. Similar logic is employed when unmounting the datasets, save for children are unmounted first. bectl(8): Change bectl_cmd_jail to pass the BE_MNT_DEEP flag when calling be_mount as well as call be_unmount when cleaning up after the jail has exited instead of umount(2) directly. PR: 234795 Changes: _U stable/12/ stable/12/lib/libbe/be.c stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_impl.h stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/bectl_jail.c stable/12/sbin/bectl/tests/bectl_test.sh |