nfsd: containerize NFSd filesystem
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Fri, 1 Feb 2013 12:56:12 +0000 (15:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jun 2014 19:04:19 +0000 (12:04 -0700)
commit6c14fee44389ab182ceab1df8fecbf2ffeb3a641
treea695879ef32931c3cba7ead8c88bbe54647a87de
parentfa16ac16fc1dfe1ddca4b4c9ce71aea73a878402
nfsd: containerize NFSd filesystem

note: this backport is just for the null pointer problem when
start nfsd in none init netns. The nfsd is still not containerized.

commit 11f779421a39b86da8a523d97e5fd3477878d44f upstream.

This patch makes NFSD file system superblock to be created per net.
This makes possible to get proper network namespace from superblock instead of
using hard-coded "init_net".

Note: NFSd fs super-block holds network namespace. This garantees, that
network namespace won't disappear from underneath of it.
This, obviously, means, that in case of kill of a container's "init" (which is not a mount
namespace, but network namespace creator) netowrk namespace won't be
destroyed.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
[wengmeiling: backport to 3.4:
 - export cache not per netns
 - NFSD service structure not per netns]
Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfsctl.c
fs/nfsd/nfssvc.c