devtmpfs: apply mount options to the existing superblock
Subsystems (2)
PATCH 1/1 devtmpfs: apply mount options to the existing superblock
Commit cb0e0a8bf4e1 ("devtmpfs: replace ->mount with ->get_tree in public instance") dropped the reconfigure_single() call that public_dev_mount() used to apply the options of every new mount to the single, internally created superblock. devtmpfs_get_tree() only takes a reference on it: the options are still parsed into fc->fs_private, but ->reconfigure is now only reached via reconfigure_super(), i.e. on remount, so they are discarded by put_fs_context().
For example, systemd mounts /dev with "-o mode=755,size=4m,nr_inodes=1m", so size= is silently ignored and /dev falls back to the tmpfs default of 50% of physical RAM.
Call the underlying ->reconfigure from devtmpfs_get_tree(), the same way tracefs and debugfs do; ramfs has no ->reconfigure, hence the NULL check.
This restores the behaviour of commit a6097180d884 ("devtmpfs regression fix: reconfigure on each mount"), which fixed the same regression when devtmpfs was first converted away from mount_single().
--- drivers/base/devtmpfs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/base/devtmpfs.c +12 -0
@@ -80,6 +80,18 @@ static int devtmpfs_get_tree(struct fs_context *fc)atomic_inc (&sb->s_active);down_write (&sb->s_umount); fc->root =dget (sb->s_root); + +if (fc->ops->reconfigure) { +int err = fc->ops->reconfigure (fc); + +if (err) { +dput (fc->root); + fc->root =NULL ; +deactivate_locked_super (sb); +return err; + } + } +return 0 ; }
Signature · 1 line
2.55.0
Greg Kroah-Hartman
maintainerQuoted 20 lines · Shigeru Yoshida
Commit
cb0e0a8bf4e1("devtmpfs: replace ->mount with ->get_tree in public instance") dropped thereconfigure_single()call thatpublic_dev_mount()used to apply the options of every new mount to the single, internally created superblock.devtmpfs_get_tree()only takes a reference on it: the options are still parsed intofc->fs_private, but ->reconfigure is now only reached viareconfigure_super(), i.e. on remount, so they are discarded byput_fs_context().For example, systemd mounts /dev with "-o mode=755,size=4m,nr_inodes=1m", so size= is silently ignored and /dev falls back to the tmpfs default of 50% of physical RAM.
Call the underlying ->reconfigure from
devtmpfs_get_tree(), the same way tracefs and debugfs do; ramfs has no ->reconfigure, hence the NULL check.This restores the behaviour of commit
a6097180d884("devtmpfs regression fix: reconfigure on each mount"), which fixed the same regression when devtmpfs was first converted away frommount_single().
Quoted 7 lines
Fixes cb0e0a8bf4e1 ("devtmpfs: replace ->mount with ->get_tree in public instance")Assisted-by Claude:claude-opus-5Signed-off-by Shigeru Yoshida <[email protected]>--- drivers/base/devtmpfs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Isn't this solved with this series:
https://lore.kernel.org/r/[email protected]
?
thanks,
greg k-h