[PATCH openEuler-1.0-LTS 0/3] Roll back the setting of nfs superblock s_flags.

Roll back the setting of nfs superblock s_flags. Li Lingfeng (3): Revert "nfs: fix the loss of superblock's initialized flags" Revert "nfs: pass flags to second superblock" Revert "nfs: ignore SB_RDONLY when mounting nfs" fs/nfs/internal.h | 2 +- fs/nfs/nfs4super.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) -- 2.31.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/15193 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/H... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/15193 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/H...

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBNEQX -------------------------------- This reverts commit 0a5788bbf138ca3841a831beed9b9cac729fe46b. Since flags passed by users can not be set to fc->sb_flags, check of fc->sb_flags in nfs_compare_mount_options is useless. The second mount may get the superblock of the first mount since nfs_compare_mount_options will return true, resulting the change of s_flags. Revert this patch and fix the origin issue later. Fixes: 0a5788bbf138 ("nfs: fix the loss of superblock's initialized flags") Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com> --- fs/nfs/nfs4super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 41cd3597e482..886be9cc0016 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -254,7 +254,7 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name, res = nfs_follow_remote_path(root_mnt, export_path); if (!IS_ERR(res)) - res->d_sb->s_flags |= (flags & SB_RDONLY); + res->d_sb->s_flags = flags; dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n", PTR_ERR_OR_ZERO(res), IS_ERR(res) ? " [error]" : ""); -- 2.31.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBNEQX -------------------------------- This reverts commit 81102eb592478c00f34fb7fac6f9de96c7130242. Since flags passed by users can not be set to fc->sb_flags, check of fc->sb_flags in nfs_compare_mount_options is useless. The second mount may get the superblock of the first mount since nfs_compare_mount_options will return true, resulting the change of s_flags. Revert this patch and fix the origin issue later. Fixes: 81102eb59247 ("nfs: pass flags to second superblock") Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com> --- fs/nfs/nfs4super.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index 886be9cc0016..e7a10f5f5405 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -253,8 +253,6 @@ struct dentry *nfs4_try_mount(int flags, const char *dev_name, res = nfs_follow_remote_path(root_mnt, export_path); - if (!IS_ERR(res)) - res->d_sb->s_flags = flags; dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n", PTR_ERR_OR_ZERO(res), IS_ERR(res) ? " [error]" : ""); -- 2.31.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBNEQX -------------------------------- This reverts commit ed901d64fb8bbdeadabbda2924fc30a89ffa6ebc. Since flags passed by users can not be set to fc->sb_flags, check of fc->sb_flags in nfs_compare_mount_options is useless. The second mount may get the superblock of the first mount since nfs_compare_mount_options will return true, resulting the change of s_flags. Revert this patch and fix the origin issue later. Fixes: ed901d64fb8b ("nfs: ignore SB_RDONLY when mounting nfs") Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com> --- fs/nfs/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 44ca5300e6e2..10572e9f6d88 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -10,7 +10,7 @@ #include <linux/nfs_page.h> #include <linux/wait_bit.h> -#define NFS_MS_MASK (SB_NOSUID|SB_NODEV|SB_NOEXEC|SB_SYNCHRONOUS) +#define NFS_MS_MASK (SB_RDONLY|SB_NOSUID|SB_NODEV|SB_NOEXEC|SB_SYNCHRONOUS) extern const struct export_operations nfs_export_ops; -- 2.31.1
participants (2)
-
Li Lingfeng
-
patchwork bot