Commit 8a9055c0 authored by Li Lingfeng's avatar Li Lingfeng
Browse files

nfs: fix the loss of superblock's initialized flags

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB42W1



--------------------------------

Commit 7c254db9 ("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: 7c254db9 ("nfs: pass flags to second superblock")
Signed-off-by: default avatarLi Lingfeng <lilingfeng3@huawei.com>
parent dd14d8eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}