Linux 3.17-rc2
[pandora-kernel.git] / fs / nilfs2 / super.c
index 8c532b2..228f5bd 100644 (file)
@@ -942,7 +942,7 @@ static int nilfs_get_root_dentry(struct super_block *sb,
                        iput(inode);
                }
        } else {
-               dentry = d_obtain_alias(inode);
+               dentry = d_obtain_root(inode);
                if (IS_ERR(dentry)) {
                        ret = PTR_ERR(dentry);
                        goto failed_dentry;
@@ -1452,13 +1452,19 @@ static int __init init_nilfs_fs(void)
        if (err)
                goto fail;
 
-       err = register_filesystem(&nilfs_fs_type);
+       err = nilfs_sysfs_init();
        if (err)
                goto free_cachep;
 
+       err = register_filesystem(&nilfs_fs_type);
+       if (err)
+               goto deinit_sysfs_entry;
+
        printk(KERN_INFO "NILFS version 2 loaded\n");
        return 0;
 
+deinit_sysfs_entry:
+       nilfs_sysfs_exit();
 free_cachep:
        nilfs_destroy_cachep();
 fail:
@@ -1468,6 +1474,7 @@ fail:
 static void __exit exit_nilfs_fs(void)
 {
        nilfs_destroy_cachep();
+       nilfs_sysfs_exit();
        unregister_filesystem(&nilfs_fs_type);
 }