hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB42W1
--------------------------------
Commit 7c254db98304 ("nfs: pass flags to second superblock") directly assigns fc->sb_flags to dentry->d_sb->s_flags, which will cause the los 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: 7c254db98304 ("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; }