Page MenuHomeFreeBSD

Unmount /dev after /.
ClosedPublic

Authored by trasz on Aug 23 2015, 3:36 PM.
Tags
None
Referenced Files
F82865148: D3467.diff
Fri, May 3, 8:34 AM
Unknown Object (File)
Feb 19 2024, 12:11 AM
Unknown Object (File)
Feb 19 2024, 12:11 AM
Unknown Object (File)
Feb 19 2024, 12:11 AM
Unknown Object (File)
Feb 19 2024, 12:11 AM
Unknown Object (File)
Feb 19 2024, 12:11 AM
Unknown Object (File)
Feb 18 2024, 11:25 PM
Unknown Object (File)
Feb 9 2024, 8:49 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 199
Build 199: arc lint + arc unit

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
3590

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.