Bug 235322

Summary: it should be possible to remount nullfs mount from readonly to writable and back
Product: Base System Reporter: Martin eto Misuth <eto.freebsd>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Many People    
Priority: ---    
Version: 12.0-RELEASE   
Hardware: Any   
OS: Any   

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.