Skip to content

Commit a609718

Browse files
neilbrowntorvalds
authored andcommitted
devtmpfs regression fix: reconfigure on each mount
Prior to Linux v5.4 devtmpfs used mount_single() which treats the given mount options as "remount" options, so it updates the configuration of the single super_block on each mount. Since that was changed, the mount options used for devtmpfs are ignored. This is a regression which affect systemd - which mounts devtmpfs with "-o mode=755,size=4m,nr_inodes=1m". This patch restores the "remount" effect by calling reconfigure_single() Fixes: d401727 ("devtmpfs: don't mix {ramfs,shmem}_fill_super() with mount_single()") Acked-by: Christian Brauner <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3c750c7 commit a609718

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

drivers/base/devtmpfs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,15 @@ static struct dentry *public_dev_mount(struct file_system_type *fs_type, int fla
6565
const char *dev_name, void *data)
6666
{
6767
struct super_block *s = mnt->mnt_sb;
68+
int err;
69+
6870
atomic_inc(&s->s_active);
6971
down_write(&s->s_umount);
72+
err = reconfigure_single(s, flags, data);
73+
if (err < 0) {
74+
deactivate_locked_super(s);
75+
return ERR_PTR(err);
76+
}
7077
return dget(s->s_root);
7178
}
7279

fs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,8 +1423,8 @@ struct dentry *mount_nodev(struct file_system_type *fs_type,
14231423
}
14241424
EXPORT_SYMBOL(mount_nodev);
14251425

1426-
static int reconfigure_single(struct super_block *s,
1427-
int flags, void *data)
1426+
int reconfigure_single(struct super_block *s,
1427+
int flags, void *data)
14281428
{
14291429
struct fs_context *fc;
14301430
int ret;

include/linux/fs_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ extern void put_fs_context(struct fs_context *fc);
142142
extern int vfs_parse_fs_param_source(struct fs_context *fc,
143143
struct fs_parameter *param);
144144
extern void fc_drop_locked(struct fs_context *fc);
145+
int reconfigure_single(struct super_block *s,
146+
int flags, void *data);
145147

146148
/*
147149
* sget() wrappers to be called from the ->get_tree() op.

0 commit comments

Comments
 (0)