[PATCH openEuler-1.0-LTS] nfs: fix the loss of superblock's initialized flags

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB42W1 -------------------------------- Commit 81102eb59247 ("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: 81102eb59247 ("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 886be9cc0016..41cd3597e482 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; + res->d_sb->s_flags |= (flags & SB_RDONLY); dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n", PTR_ERR_OR_ZERO(res), IS_ERR(res) ? " [error]" : ""); -- 2.31.1

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