nfsd: don't allow legacy client tracker init for anything but init_net
authorJeff Layton <jlayton@redhat.com>
Wed, 21 Mar 2012 13:52:09 +0000 (09:52 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 26 Mar 2012 15:49:48 +0000 (11:49 -0400)
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>
fs/nfsd/nfs4recover.c

index 6f13281635ba249813f72ccb39ddd5abd2c18710..21b53d57432cfdcab5545df6d56a494403450cd5 100644 (file)
@@ -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)