Merge branch 'zpl'
[zfs.git] / module / zfs / zvol.c
index 6e92942..04c885f 100644 (file)
@@ -1002,6 +1002,8 @@ static int
 zvol_ioctl_by_inode(struct inode *inode, struct file *file,
                     unsigned int cmd, unsigned long arg)
 {
+       if (file == NULL || inode == NULL)
+               return -EINVAL;
        return zvol_ioctl(inode->i_bdev, file->f_mode, cmd, arg);
 }
 
@@ -1010,6 +1012,8 @@ static long
 zvol_compat_ioctl_by_inode(struct file *file,
                            unsigned int cmd, unsigned long arg)
 {
+       if (file == NULL)
+               return -EINVAL;
        return zvol_compat_ioctl(file->f_dentry->d_inode->i_bdev,
                                 file->f_mode, cmd, arg);
 }
@@ -1058,6 +1062,8 @@ zvol_alloc(dev_t dev, const char *name)
        mutex_init(&zv->zv_znode.z_range_lock, NULL, MUTEX_DEFAULT, NULL);
        avl_create(&zv->zv_znode.z_range_avl, zfs_range_compare,
            sizeof (rl_t), offsetof(rl_t, r_node));
+       zv->zv_znode.z_is_zvol = TRUE;
+
        spin_lock_init(&zv->zv_lock);
        list_link_init(&zv->zv_next);
 
@@ -1224,7 +1230,8 @@ zvol_create_minors_cb(spa_t *spa, uint64_t dsobj,
        if (strchr(dsname, '/') == NULL)
                return 0;
 
-       return __zvol_create_minor(dsname);
+       (void) __zvol_create_minor(dsname);
+       return (0);
 }
 
 /*