mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 18:55:12 +00:00
nfs: keep server info for remounts
[ Upstream commitb322bf9e98
] With newer kernels that use fs_context for nfs mounts, remounts fail with -EINVAL. $ mount -t nfs -o nolock 10.0.0.1:/tmp/test /mnt/test/ $ mount -t nfs -o remount /mnt/test/ mount: mounting 10.0.0.1:/tmp/test on /mnt/test failed: Invalid argument For remounts, the nfs server address and port are populated by nfs_init_fs_context and later overwritten with 0x00 bytes by nfs23_parse_monolithic. The remount then fails as the server address is invalid. Fix this by not overwriting nfs server info in nfs23_parse_monolithic if we're doing a remount. Fixes:f2aedb713c
("NFS: Add fs_context support.") Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b72a3a25c2
commit
99530e42e1
@ -1047,9 +1047,12 @@ static int nfs23_parse_monolithic(struct fs_context *fc,
|
||||
ctx->acdirmax = data->acdirmax;
|
||||
ctx->need_mount = false;
|
||||
|
||||
memcpy(sap, &data->addr, sizeof(data->addr));
|
||||
ctx->nfs_server.addrlen = sizeof(data->addr);
|
||||
ctx->nfs_server.port = ntohs(data->addr.sin_port);
|
||||
if (!is_remount_fc(fc)) {
|
||||
memcpy(sap, &data->addr, sizeof(data->addr));
|
||||
ctx->nfs_server.addrlen = sizeof(data->addr);
|
||||
ctx->nfs_server.port = ntohs(data->addr.sin_port);
|
||||
}
|
||||
|
||||
if (sap->ss_family != AF_INET ||
|
||||
!nfs_verify_server_address(sap))
|
||||
goto out_no_address;
|
||||
|
Loading…
Reference in New Issue
Block a user