]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - security/smack/smackfs.c
[MIPS] Alchemy: move UART platform code to its proper place
[linux-2.6-omap-h63xx.git] / security / smack / smackfs.c
index cfae8afcc262d9fd9e18e3b79f45b5a3f4598bd8..6ba283783b70af178d7c66bca1e44eb632674f2b 100644 (file)
@@ -965,12 +965,21 @@ static struct vfsmount *smackfs_mount;
  *
  * register the smackfs
  *
- * Returns 0 unless the registration fails.
+ * Do not register smackfs if Smack wasn't enabled
+ * on boot. We can not put this method normally under the
+ * smack_init() code path since the security subsystem get
+ * initialized before the vfs caches.
+ *
+ * Returns true if we were not chosen on boot or if
+ * we were chosen and filesystem registration succeeded.
  */
 static int __init init_smk_fs(void)
 {
        int err;
 
+       if (!security_module_enable(&smack_ops))
+               return 0;
+
        err = register_filesystem(&smk_fs_type);
        if (!err) {
                smackfs_mount = kern_mount(&smk_fs_type);