提交 96de7a9d 编写于 作者: E Eric W. Biederman 提交者: Yang Yingliang

fs/nfs: Fix nfs_parse_devname to not modify it's argument

[ Upstream commit 40cc394be1aa18848b8757e03bd8ed23281f572e ]

In the rare and unsupported case of a hostname list nfs_parse_devname
will modify dev_name.  There is no need to modify dev_name as the all
that is being computed is the length of the hostname, so the computed
length can just be shorted.

Fixes: dc045898 ("NFS: Use common device name parsing logic for NFSv4 and NFSv2/v3")
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 e4586e6b
...@@ -1930,7 +1930,7 @@ static int nfs_parse_devname(const char *dev_name, ...@@ -1930,7 +1930,7 @@ static int nfs_parse_devname(const char *dev_name,
/* kill possible hostname list: not supported */ /* kill possible hostname list: not supported */
comma = strchr(dev_name, ','); comma = strchr(dev_name, ',');
if (comma != NULL && comma < end) if (comma != NULL && comma < end)
*comma = 0; len = comma - dev_name;
} }
if (len > maxnamlen) if (len > maxnamlen)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册