Fix build failures on PaX/GRSecurity patched kernels
[zfs.git] / module / zfs / zfs_vfsops.c
index 8f1c713..6d75326 100644 (file)
@@ -1200,7 +1200,7 @@ zfs_domount(struct super_block *sb, void *data, int silent)
        }
 
        /* Allocate a root dentry for the filesystem */
-       sb->s_root = d_alloc_root(root_inode);
+       sb->s_root = d_make_root(root_inode);
        if (sb->s_root == NULL) {
                (void) zfs_umount(sb);
                error = ENOMEM;
@@ -1231,7 +1231,7 @@ zfs_preumount(struct super_block *sb)
 {
        zfs_sb_t *zsb = sb->s_fs_info;
 
-       if (zsb->z_ctldir != NULL)
+       if (zsb != NULL && zsb->z_ctldir != NULL)
                zfsctl_destroy(zsb);
 }
 EXPORT_SYMBOL(zfs_preumount);