This basically makes "mount -uw /" work when the filesystem mountedon / is NFS, but the one configured in fstab(5) is UFS, which canhappen when you forget to modify fstab to work with... which for some reason happens every single time.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Can you explain why this special case is required ?
I find it somewhat surprising if the mount -uw / worked when my fstab is wrong, i.e. I expect that mount /something should fail if fstab is not correct.
Also, you check the fstab filesystem type. What if the type is right, but options are incompatible ?
I don't have a slightest idea why the special case is required. But it might be, and removing it altogether might break somebody's system. Adding additional condition is much less intrusive, and thus safer.
By 'special case' I mean the fs type inconsistency, not the case of root mount update.
That said, the comment before the if (getfsfile()) line explaining the special case is wrong. The working "mount -u /" should be not special, as in, "mount -u <other fs mnt point>" ought to work, IMO.
The special case of checking the filesystem is added to reduce the other special case - the one for / - so it doesn't apply if the filesystem doesn't match. I kind of agree that "mount -u /" shouldn't be special, but as I've said - there might be something out there that will get broken by removing it. So instead I'm trying to just fix the case that's clearly broken (it results in mount(8) executing something like "mount_nfs -o remount,rw /dev/ada0 /") and not touching others.