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