From: Greg Kroah-Hartman Date: Mon, 17 Jan 2022 10:06:56 +0000 (+0100) Subject: 5.16-stable patches X-Git-Tag: v5.16.2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7509fb50bbad4c30d910dede064baae039de1d94;p=thirdparty%2Fkernel%2Fstable-queue.git 5.16-stable patches added patches: devtmpfs-regression-fix-reconfigure-on-each-mount.patch --- diff --git a/queue-5.16/devtmpfs-regression-fix-reconfigure-on-each-mount.patch b/queue-5.16/devtmpfs-regression-fix-reconfigure-on-each-mount.patch new file mode 100644 index 00000000000..febf754903e --- /dev/null +++ b/queue-5.16/devtmpfs-regression-fix-reconfigure-on-each-mount.patch @@ -0,0 +1,73 @@ +From a6097180d884ddab769fb25588ea8598589c218c Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Mon, 17 Jan 2022 09:07:26 +1100 +Subject: devtmpfs regression fix: reconfigure on each mount + +From: NeilBrown + +commit a6097180d884ddab769fb25588ea8598589c218c upstream. + +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: d401727ea0d7 ("devtmpfs: don't mix {ramfs,shmem}_fill_super() with mount_single()") +Acked-by: Christian Brauner +Cc: Al Viro +Signed-off-by: NeilBrown +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + drivers/base/devtmpfs.c | 7 +++++++ + fs/super.c | 4 ++-- + include/linux/fs_context.h | 2 ++ + 3 files changed, 11 insertions(+), 2 deletions(-) + +--- a/drivers/base/devtmpfs.c ++++ b/drivers/base/devtmpfs.c +@@ -59,8 +59,15 @@ static struct dentry *public_dev_mount(s + const char *dev_name, void *data) + { + struct super_block *s = mnt->mnt_sb; ++ int err; ++ + atomic_inc(&s->s_active); + down_write(&s->s_umount); ++ err = reconfigure_single(s, flags, data); ++ if (err < 0) { ++ deactivate_locked_super(s); ++ return ERR_PTR(err); ++ } + return dget(s->s_root); + } + +--- a/fs/super.c ++++ b/fs/super.c +@@ -1423,8 +1423,8 @@ struct dentry *mount_nodev(struct file_s + } + EXPORT_SYMBOL(mount_nodev); + +-static int reconfigure_single(struct super_block *s, +- int flags, void *data) ++int reconfigure_single(struct super_block *s, ++ int flags, void *data) + { + struct fs_context *fc; + int ret; +--- a/include/linux/fs_context.h ++++ b/include/linux/fs_context.h +@@ -142,6 +142,8 @@ extern void put_fs_context(struct fs_con + extern int vfs_parse_fs_param_source(struct fs_context *fc, + struct fs_parameter *param); + extern void fc_drop_locked(struct fs_context *fc); ++int reconfigure_single(struct super_block *s, ++ int flags, void *data); + + /* + * sget() wrappers to be called from the ->get_tree() op. diff --git a/queue-5.16/series b/queue-5.16/series new file mode 100644 index 00000000000..12787d2c4b5 --- /dev/null +++ b/queue-5.16/series @@ -0,0 +1 @@ +devtmpfs-regression-fix-reconfigure-on-each-mount.patch