summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4recover.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-03-21 09:52:09 -0400
committerJ. Bruce Fields <bfields@redhat.com>2012-03-26 11:49:48 -0400
commitcc27e0d407021a278d08c1952f5af4ab38c49eda (patch)
tree553dcc5c2acdce04caab305c02693303abb4e822 /fs/nfsd/nfs4recover.c
parent813fd320c16691eac508fe350b4ee7362c6c4a56 (diff)
downloadlinux-cc27e0d407021a278d08c1952f5af4ab38c49eda.tar.bz2
nfsd: don't allow legacy client tracker init for anything but init_net
This code isn't set up for containers, so don't allow it to be used for anything but init_net. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4recover.c')
-rw-r--r--fs/nfsd/nfs4recover.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 6f13281635ba..21b53d57432c 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -416,6 +416,13 @@ nfsd4_load_reboot_recovery_data(struct net *net)
{
int status;
+ /* XXX: The legacy code won't work in a container */
+ if (net != &init_net) {
+ WARN(1, KERN_ERR "NFSD: attempt to initialize legacy client "
+ "tracking in a container!\n");
+ return -EINVAL;
+ }
+
nfs4_lock_state();
status = nfsd4_init_recdir();
if (!status)