[PATCH OLK-6.6 0/3] Fix the problem of NFS client mount read/write permission failure

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 | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) -- 2.31.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBNEQX -------------------------------- This reverts commit a94b6e8ae792a9fd1cf555ffe46d39a4961cdfd9. 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: a94b6e8ae792 ("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 e87f878178f3..bb13894ad152 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -209,7 +209,7 @@ static int do_nfs4_mount(struct nfs_server *server, if (IS_ERR(dentry)) return PTR_ERR(dentry); - dentry->d_sb->s_flags |= (fc->sb_flags & SB_RDONLY); + dentry->d_sb->s_flags = fc->sb_flags; fc->root = dentry; return 0; } -- 2.31.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBNEQX -------------------------------- This reverts commit 573573887e0b392ca7ea601ade60517ed8900f23. 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: 573573887e0b ("nfs: pass flags to second superblock") Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com> --- fs/nfs/nfs4super.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index bb13894ad152..d09bcfd7db89 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c @@ -209,7 +209,6 @@ static int do_nfs4_mount(struct nfs_server *server, if (IS_ERR(dentry)) return PTR_ERR(dentry); - dentry->d_sb->s_flags = fc->sb_flags; fc->root = dentry; return 0; } -- 2.31.1

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBNEQX -------------------------------- This reverts commit 079462747c15ae356b74b161796127d376f8aa10. 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: 079462747c15 ("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 27f39c0ac8a1..5844c03166ba 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -11,7 +11,7 @@ #include <linux/nfs_page.h> #include <linux/wait_bit.h> -#define NFS_SB_MASK (SB_NOSUID|SB_NODEV|SB_NOEXEC|SB_SYNCHRONOUS) +#define NFS_SB_MASK (SB_RDONLY|SB_NOSUID|SB_NODEV|SB_NOEXEC|SB_SYNCHRONOUS) extern const struct export_operations nfs_export_ops; -- 2.31.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/16680 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ZPA... 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/16680 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/ZPA...
participants (2)
-
Li Lingfeng
-
patchwork bot