[PATCH OLK-6.6] nfs: fix the loss of superblock's initialized flags

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB42W1 -------------------------------- Commit 573573887e0b ("nfs: pass flags to second superblock") directly assigns fc->sb_flags to dentry->d_sb->s_flags, which will cause the loss of the initialized flags in dentry->d_sb->s_flags. Fix it by just passing SB_RDONLY from fc->sb_flags to dentry->d_sb->s_flags. Fixes: 573573887e0b ("nfs: pass flags to second superblock") 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 bb13894ad152..e87f878178f3 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; + dentry->d_sb->s_flags |= (fc->sb_flags & SB_RDONLY); fc->root = dentry; return 0; } -- 2.31.1

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