Page MenuHomeFreeBSD

Change be_mount to mount/unmount child datasets
ClosedPublic

Authored by jwmaag_gmail.com on Jan 9 2019, 6:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 16 2024, 1:28 AM
Unknown Object (File)
Mar 16 2024, 1:28 AM
Unknown Object (File)
Mar 16 2024, 1:27 AM
Unknown Object (File)
Feb 23 2024, 5:42 AM
Unknown Object (File)
Dec 22 2023, 4:51 PM
Unknown Object (File)
Dec 20 2023, 3:32 AM
Unknown Object (File)
Dec 13 2023, 5:20 AM
Unknown Object (File)
Oct 25 2023, 10:05 PM
Subscribers

Details

Summary

lib/libbe: 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.

sbin/bectl: change bectl_cmd_jail to pass the BE_MNT_DEEP flag when
calling be_mount as well as call be_unount when cleaning up after the
jail has exited.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234795

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 21902
Build 21146: arc lint + arc unit

Event Timeline

Change bectl_cmd_unjail to call be_unmount instead of unmount

lib/libbe/be_access.c
71

Small nit while we're here: capitalize the 'c'

80

style(9) nit: these two should be in alphabetical order

85

Space before the opening bracket here

97

style(9) nit: no extra spacing around this strcmp(...) != 0

121

style(9) nit: space after if

124

Might as well return (zfs_iter_filesystems(...)) here

139

Space before the opening brace, and parentheses around the return valuej ust below return (err)

143

Space before the opening brace

242

I think we should set_error on this one

252

Parentheses around the return value

286

Parentheses around the return value

As of r342903, be_mount_iter should be amended to do: mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); if we're looking at a mountpoint != none and use mountpoint instead of zfs_mnt in the subsequent snprintf.

We also have an ordering issue with be_umount_iter -- if I have zpool/ROOT/default/usr and mount this to /mnt, we'll currently zfs_iter_filesystems(zpool/ROOT/default) and unmount the first one we hit, which is at /mnt. We can't unmount /mnt until we hit all the children, of course, so it blows up.

Use be_mountpoint_augmented to get the mountpoint in case of altroot scenarios.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 10 2019, 3:27 AM
This revision was automatically updated to reflect the committed changes.