From a94b6e8ae792a9fd1cf555ffe46d39a4961cdfd9 Mon Sep 17 00:00:00 2001 From: Li Lingfeng Date: Mon, 16 Dec 2024 20:15:25 +0800 Subject: [PATCH] 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 --- 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; } -- Gitee