nfs: Enclose hostname in brackets when needed in nfs_do_root_mount
authorJan Kara <jack@suse.cz>
Fri, 2 Sep 2011 23:09:43 +0000 (01:09 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 May 2012 12:14:28 +0000 (13:14 +0100)
commitbcd008fcd3c3d6e50ffc4eb5cf6b7f25f3d1d1dd
tree1a87e259a87df85b8627bfe9d68edd050c2121d2
parent0d8421fee40cb7a579e3793957b6f74b259fb1b9
nfs: Enclose hostname in brackets when needed in nfs_do_root_mount

commit 98a2139f4f4d7b5fcc3a54c7fddbe88612abed20 upstream.

When hostname contains colon (e.g. when it is an IPv6 address) it needs
to be enclosed in brackets to make parsing of NFS device string possible.
Fix nfs_do_root_mount() to enclose hostname properly when needed. NFS code
actually does not need this as it does not parse the string passed by
nfs_do_root_mount() but the device string is exposed to userspace in
/proc/mounts.

CC: Josh Boyer <jwboyer@redhat.com>
CC: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/super.c