-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: mount: define new option string "rro" for MOUNT_ATTR_RDONLY
+ AT_RECURSIVE
#1501
Comments
I like the idea, but it's definitely not about I'll try to implement rro in some basic way already for the next release ( But, my long-term goal is to move libmount to the new kernel API (open_tree(), move_mount(), fsconfig, mount_setattr(), and explicitly differentiate between set/clear to make it more user-friendly, something like
|
I'm loving this plan! |
@karelzak Thanks for your recent work on the Isn't this a breaking change? Potential existing usecases of non-recursive read-only recursive bind mounts would be like:
|
I guess if you use any flags with recursive (bind) operation, then it's expected that you also want the flag to apply recursively, but ... ... unfortunately, now I see that classic mount(2) interprets MS_REC|MS_REMOUNT|MS_BIND|MS_RDONLY as non-recursive operation, and it sets only first VFS node read-only ;-(((
But the same for the current libmount ends with:
Anyway, I'm still not sure if introducing a recursive variant for all VFS flags (nosuid, rnosuid, ..) is the right way to go. BTW, there is also the suggestion from Lennart to use arguments for the flag to specify where to apply the flag (vfs, fs, blkdev). Maybe we can use the same to set it recursive (ro=recursive).
Yes, |
mount -o bind,ro=recursive,nosuid /foo /bar sets all sub-mount to read-only, but only /bar will be nosuid. Addresses: #1501 Signed-off-by: Karel Zak <[email protected]>
Implemented as ro=recursive. |
Background
So far,
mount -o ro,rbind
has not been recursively read-only.Kernel 5.12 added a new syscall
mount_setattr(2)
for supporting recursively read-only mounts, but this syscall is not currently used by themount(8)
command ofutil-linux
.RFE
I suggest defining a new
mount(8)
option string "rro" for supportingMOUNT_ATTR_RDONLY
+AT_RECURSIVE
."rro" is chosen for consistency with other existing option strings like "rprivate" (recursive "private").
The behavior of the existing "ro" option should remain unchaged, for compatibility reason.
The text was updated successfully, but these errors were encountered: