Page MenuHomeFreeBSD

Unmount /dev after /.
ClosedPublic

Authored by trasz on Aug 23 2015, 3:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 19 2024, 3:58 PM
Unknown Object (File)
Oct 18 2024, 9:57 AM
Unknown Object (File)
Oct 3 2024, 2:11 PM
Unknown Object (File)
Oct 2 2024, 11:03 PM
Unknown Object (File)
Oct 2 2024, 7:13 AM
Unknown Object (File)
Sep 30 2024, 9:29 PM
Unknown Object (File)
Sep 23 2024, 4:45 AM
Unknown Object (File)
Sep 20 2024, 9:35 AM
Subscribers

Details

Summary

Without this change, vfs_unmountall() tries to unmount /dev
before unmounting /. The only reason this doesn't result in unclean
shutdown is that devfs ignores MNT_FORCE flag.

This could be done in a more complicated ways - eg using a new mount
flag - but I don't see the advantages over this - quite basic - solution.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz retitled this revision from to Unmount /dev after /..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)
trasz added a reviewer: kib.

Oh, one more thing - after this change, the "mp" argument in vfs_mountroot_devfs() is _probably_ superfluous. However, the logic in vfs_mountroot() is kind of convoluted; it uses some config file, but it's completely undocumented, and thus hard to test. So I'd rather change as little code there as possible to avoid breaking something.

trasz updated this object.

Remove debugging printf.

sys/kern/vfs_subr.c
3588 ↗(On Diff #8152)

Since you check rootdevmp for NULL, I suggest assigning NULL to it after successfull unmount.

Also, consider a case when user did umount /dev manually.

Handle the case where /dev gets unmounted.

kib edited edge metadata.
This revision is now accepted and ready to land.Aug 24 2015, 12:01 PM
This revision was automatically updated to reflect the committed changes.