summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mguzik@redhat.com>2014-06-10 12:44:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-06 18:59:11 -0700
commitff177fb44d47f46567543127e3ad42936b31c71f (patch)
treeb678db4637ed9e2169d88346b38e3c030f1761e3
parentca3fd5c679515e152f2e7feb980ebe8c444d5b18 (diff)
NFS: populate ->net in mount data when remounting
commit a914722f333b3359d2f4f12919380a334176bb89 upstream. Otherwise the kernel oopses when remounting with IPv6 server because net is dereferenced in dev_get_by_name. Use net ns of current thread so that dev_get_by_name does not operate on foreign ns. Changing the address is prohibited anyway so this should not affect anything. Signed-off-by: Mateusz Guzik <mguzik@redhat.com> Cc: linux-nfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/nfs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2cb56943e232..104ef01d694d 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2248,6 +2248,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
data->nfs_server.addrlen = nfss->nfs_client->cl_addrlen;
data->version = nfsvers;
data->minorversion = nfss->nfs_client->cl_minorversion;
+ data->net = current->nsproxy->net_ns;
memcpy(&data->nfs_server.address, &nfss->nfs_client->cl_addr,
data->nfs_server.addrlen);