Bug 235322 - it should be possible to remount nullfs mount from readonly to writable and back
Summary: it should be possible to remount nullfs mount from readonly to writable and back
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-30 14:30 UTC by Martin eto Misuth
Modified: 2019-01-30 14:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin eto Misuth 2019-01-30 14:30:59 UTC
This has been bugging me for quite some time, but it seems, that it is impossible to remount nullfs mount from "ro" to "rw" and back, without actually unmounting it first and then remounting it back the other way. Since nobody seems to know or cares about it, I am creating this bug.

Case in point:

01 # mkdir ~/test
02 # mount -o ro -t nullfs /etc /usr/home/eto/test

So far all is good, but now:

01 # mount -o rw /usr/home/eto/test
02 > mount: /usr/home/eto/test: unknown special file or file system
03 # mount -o rw /etc /usr/home/eto/test
04 > mount: /etc: Block device required

It's been some time when I played with nmount() from C, but if I remember correctly, one gets "not supported" error when trying to update mount flags.

I tried to look at nullfs code, but it's hard to follow for non-kernel experienced programmers.

Anyway I believe sysadmins should be able to change writability flags of nuffs mounts (like when updating jails). "ro" mounted jails are very sturdy and protected against unexpected modifications, but are quite the hassle during base updates.