diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-map.c | 6 | ||||
-rw-r--r-- | block/genhd.c | 2 | ||||
-rw-r--r-- | block/ioctl.c | 7 |
3 files changed, 11 insertions, 4 deletions
diff --git a/block/blk-map.c b/block/blk-map.c index 4849fa36161e..0f4b4b881811 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -217,6 +217,12 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
217 | return PTR_ERR(bio); | 217 | return PTR_ERR(bio); |
218 | 218 | ||
219 | if (bio->bi_size != len) { | 219 | if (bio->bi_size != len) { |
220 | /* | ||
221 | * Grab an extra reference to this bio, as bio_unmap_user() | ||
222 | * expects to be able to drop it twice as it happens on the | ||
223 | * normal IO completion path | ||
224 | */ | ||
225 | bio_get(bio); | ||
220 | bio_endio(bio, 0); | 226 | bio_endio(bio, 0); |
221 | bio_unmap_user(bio); | 227 | bio_unmap_user(bio); |
222 | return -EINVAL; | 228 | return -EINVAL; |
diff --git a/block/genhd.c b/block/genhd.c index 4e5e7493f676..27549e470da5 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -768,6 +768,8 @@ static int __init genhd_device_init(void) | |||
768 | bdev_map = kobj_map_init(base_probe, &block_class_lock); | 768 | bdev_map = kobj_map_init(base_probe, &block_class_lock); |
769 | blk_dev_init(); | 769 | blk_dev_init(); |
770 | 770 | ||
771 | register_blkdev(BLOCK_EXT_MAJOR, "blkext"); | ||
772 | |||
771 | #ifndef CONFIG_SYSFS_DEPRECATED | 773 | #ifndef CONFIG_SYSFS_DEPRECATED |
772 | /* create top-level block dir */ | 774 | /* create top-level block dir */ |
773 | block_depr = kobject_create_and_add("block", NULL); | 775 | block_depr = kobject_create_and_add("block", NULL); |
diff --git a/block/ioctl.c b/block/ioctl.c index c832d639b6e2..d03985b04d67 100644 --- a/block/ioctl.c +++ b/block/ioctl.c | |||
@@ -18,7 +18,6 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user | |||
18 | struct disk_part_iter piter; | 18 | struct disk_part_iter piter; |
19 | long long start, length; | 19 | long long start, length; |
20 | int partno; | 20 | int partno; |
21 | int err; | ||
22 | 21 | ||
23 | if (!capable(CAP_SYS_ADMIN)) | 22 | if (!capable(CAP_SYS_ADMIN)) |
24 | return -EACCES; | 23 | return -EACCES; |
@@ -61,10 +60,10 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user | |||
61 | disk_part_iter_exit(&piter); | 60 | disk_part_iter_exit(&piter); |
62 | 61 | ||
63 | /* all seems OK */ | 62 | /* all seems OK */ |
64 | err = add_partition(disk, partno, start, length, | 63 | part = add_partition(disk, partno, start, length, |
65 | ADDPART_FLAG_NONE); | 64 | ADDPART_FLAG_NONE); |
66 | mutex_unlock(&bdev->bd_mutex); | 65 | mutex_unlock(&bdev->bd_mutex); |
67 | return err; | 66 | return IS_ERR(part) ? PTR_ERR(part) : 0; |
68 | case BLKPG_DEL_PARTITION: | 67 | case BLKPG_DEL_PARTITION: |
69 | part = disk_get_part(disk, partno); | 68 | part = disk_get_part(disk, partno); |
70 | if (!part) | 69 | if (!part) |