diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/floppy.c | 17 | ||||
-rw-r--r-- | drivers/block/loop.c | 24 | ||||
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 11 | ||||
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.h | 5 | ||||
-rw-r--r-- | drivers/block/rbd.c | 7 |
5 files changed, 39 insertions, 25 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 510fb10ec45a..9baf11e86362 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -4368,8 +4368,14 @@ out_unreg_blkdev: | |||
4368 | out_put_disk: | 4368 | out_put_disk: |
4369 | while (dr--) { | 4369 | while (dr--) { |
4370 | del_timer_sync(&motor_off_timer[dr]); | 4370 | del_timer_sync(&motor_off_timer[dr]); |
4371 | if (disks[dr]->queue) | 4371 | if (disks[dr]->queue) { |
4372 | blk_cleanup_queue(disks[dr]->queue); | 4372 | blk_cleanup_queue(disks[dr]->queue); |
4373 | /* | ||
4374 | * put_disk() is not paired with add_disk() and | ||
4375 | * will put queue reference one extra time. fix it. | ||
4376 | */ | ||
4377 | disks[dr]->queue = NULL; | ||
4378 | } | ||
4373 | put_disk(disks[dr]); | 4379 | put_disk(disks[dr]); |
4374 | } | 4380 | } |
4375 | return err; | 4381 | return err; |
@@ -4579,6 +4585,15 @@ static void __exit floppy_module_exit(void) | |||
4579 | platform_device_unregister(&floppy_device[drive]); | 4585 | platform_device_unregister(&floppy_device[drive]); |
4580 | } | 4586 | } |
4581 | blk_cleanup_queue(disks[drive]->queue); | 4587 | blk_cleanup_queue(disks[drive]->queue); |
4588 | |||
4589 | /* | ||
4590 | * These disks have not called add_disk(). Don't put down | ||
4591 | * queue reference in put_disk(). | ||
4592 | */ | ||
4593 | if (!(allowed_drive_mask & (1 << drive)) || | ||
4594 | fdc_state[FDC(drive)].version == FDC_NONE) | ||
4595 | disks[drive]->queue = NULL; | ||
4596 | |||
4582 | put_disk(disks[drive]); | 4597 | put_disk(disks[drive]); |
4583 | } | 4598 | } |
4584 | 4599 | ||
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index f00257782fcc..cd504353b278 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -356,14 +356,14 @@ lo_direct_splice_actor(struct pipe_inode_info *pipe, struct splice_desc *sd) | |||
356 | return __splice_from_pipe(pipe, sd, lo_splice_actor); | 356 | return __splice_from_pipe(pipe, sd, lo_splice_actor); |
357 | } | 357 | } |
358 | 358 | ||
359 | static int | 359 | static ssize_t |
360 | do_lo_receive(struct loop_device *lo, | 360 | do_lo_receive(struct loop_device *lo, |
361 | struct bio_vec *bvec, int bsize, loff_t pos) | 361 | struct bio_vec *bvec, int bsize, loff_t pos) |
362 | { | 362 | { |
363 | struct lo_read_data cookie; | 363 | struct lo_read_data cookie; |
364 | struct splice_desc sd; | 364 | struct splice_desc sd; |
365 | struct file *file; | 365 | struct file *file; |
366 | long retval; | 366 | ssize_t retval; |
367 | 367 | ||
368 | cookie.lo = lo; | 368 | cookie.lo = lo; |
369 | cookie.page = bvec->bv_page; | 369 | cookie.page = bvec->bv_page; |
@@ -379,26 +379,28 @@ do_lo_receive(struct loop_device *lo, | |||
379 | file = lo->lo_backing_file; | 379 | file = lo->lo_backing_file; |
380 | retval = splice_direct_to_actor(file, &sd, lo_direct_splice_actor); | 380 | retval = splice_direct_to_actor(file, &sd, lo_direct_splice_actor); |
381 | 381 | ||
382 | if (retval < 0) | 382 | return retval; |
383 | return retval; | ||
384 | if (retval != bvec->bv_len) | ||
385 | return -EIO; | ||
386 | return 0; | ||
387 | } | 383 | } |
388 | 384 | ||
389 | static int | 385 | static int |
390 | lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t pos) | 386 | lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t pos) |
391 | { | 387 | { |
392 | struct bio_vec *bvec; | 388 | struct bio_vec *bvec; |
393 | int i, ret = 0; | 389 | ssize_t s; |
390 | int i; | ||
394 | 391 | ||
395 | bio_for_each_segment(bvec, bio, i) { | 392 | bio_for_each_segment(bvec, bio, i) { |
396 | ret = do_lo_receive(lo, bvec, bsize, pos); | 393 | s = do_lo_receive(lo, bvec, bsize, pos); |
397 | if (ret < 0) | 394 | if (s < 0) |
395 | return s; | ||
396 | |||
397 | if (s != bvec->bv_len) { | ||
398 | zero_fill_bio(bio); | ||
398 | break; | 399 | break; |
400 | } | ||
399 | pos += bvec->bv_len; | 401 | pos += bvec->bv_len; |
400 | } | 402 | } |
401 | return ret; | 403 | return 0; |
402 | } | 404 | } |
403 | 405 | ||
404 | static int do_bio_filebacked(struct loop_device *lo, struct bio *bio) | 406 | static int do_bio_filebacked(struct loop_device *lo, struct bio *bio) |
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index b74eab70c3d0..8eb81c96608f 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -2068,8 +2068,6 @@ static int mtip_hw_ioctl(struct driver_data *dd, unsigned int cmd, | |||
2068 | * when the read completes. | 2068 | * when the read completes. |
2069 | * @data Callback data passed to the callback function | 2069 | * @data Callback data passed to the callback function |
2070 | * when the read completes. | 2070 | * when the read completes. |
2071 | * @barrier If non-zero, this command must be completed before | ||
2072 | * issuing any other commands. | ||
2073 | * @dir Direction (read or write) | 2071 | * @dir Direction (read or write) |
2074 | * | 2072 | * |
2075 | * return value | 2073 | * return value |
@@ -2077,7 +2075,7 @@ static int mtip_hw_ioctl(struct driver_data *dd, unsigned int cmd, | |||
2077 | */ | 2075 | */ |
2078 | static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, | 2076 | static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, |
2079 | int nsect, int nents, int tag, void *callback, | 2077 | int nsect, int nents, int tag, void *callback, |
2080 | void *data, int barrier, int dir) | 2078 | void *data, int dir) |
2081 | { | 2079 | { |
2082 | struct host_to_dev_fis *fis; | 2080 | struct host_to_dev_fis *fis; |
2083 | struct mtip_port *port = dd->port; | 2081 | struct mtip_port *port = dd->port; |
@@ -2108,8 +2106,6 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, | |||
2108 | *((unsigned int *) &fis->lba_low) = (start & 0xFFFFFF); | 2106 | *((unsigned int *) &fis->lba_low) = (start & 0xFFFFFF); |
2109 | *((unsigned int *) &fis->lba_low_ex) = ((start >> 24) & 0xFFFFFF); | 2107 | *((unsigned int *) &fis->lba_low_ex) = ((start >> 24) & 0xFFFFFF); |
2110 | fis->device = 1 << 6; | 2108 | fis->device = 1 << 6; |
2111 | if (barrier) | ||
2112 | fis->device |= FUA_BIT; | ||
2113 | fis->features = nsect & 0xFF; | 2109 | fis->features = nsect & 0xFF; |
2114 | fis->features_ex = (nsect >> 8) & 0xFF; | 2110 | fis->features_ex = (nsect >> 8) & 0xFF; |
2115 | fis->sect_count = ((tag << 3) | (tag >> 5)); | 2111 | fis->sect_count = ((tag << 3) | (tag >> 5)); |
@@ -3087,7 +3083,6 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio) | |||
3087 | tag, | 3083 | tag, |
3088 | bio_endio, | 3084 | bio_endio, |
3089 | bio, | 3085 | bio, |
3090 | bio->bi_rw & REQ_FUA, | ||
3091 | bio_data_dir(bio)); | 3086 | bio_data_dir(bio)); |
3092 | } else | 3087 | } else |
3093 | bio_io_error(bio); | 3088 | bio_io_error(bio); |
@@ -3187,6 +3182,10 @@ skip_create_disk: | |||
3187 | blk_queue_max_segments(dd->queue, MTIP_MAX_SG); | 3182 | blk_queue_max_segments(dd->queue, MTIP_MAX_SG); |
3188 | blk_queue_physical_block_size(dd->queue, 4096); | 3183 | blk_queue_physical_block_size(dd->queue, 4096); |
3189 | blk_queue_io_min(dd->queue, 4096); | 3184 | blk_queue_io_min(dd->queue, 4096); |
3185 | /* | ||
3186 | * write back cache is not supported in the device. FUA depends on | ||
3187 | * write back cache support, hence setting flush support to zero. | ||
3188 | */ | ||
3190 | blk_queue_flush(dd->queue, 0); | 3189 | blk_queue_flush(dd->queue, 0); |
3191 | 3190 | ||
3192 | /* Set the capacity of the device in 512 byte sectors. */ | 3191 | /* Set the capacity of the device in 512 byte sectors. */ |
diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h index 723d7c4946dc..e0554a8f2233 100644 --- a/drivers/block/mtip32xx/mtip32xx.h +++ b/drivers/block/mtip32xx/mtip32xx.h | |||
@@ -104,9 +104,6 @@ | |||
104 | /* BAR number used to access the HBA registers. */ | 104 | /* BAR number used to access the HBA registers. */ |
105 | #define MTIP_ABAR 5 | 105 | #define MTIP_ABAR 5 |
106 | 106 | ||
107 | /* Forced Unit Access Bit */ | ||
108 | #define FUA_BIT 0x80 | ||
109 | |||
110 | #ifdef DEBUG | 107 | #ifdef DEBUG |
111 | #define dbg_printk(format, arg...) \ | 108 | #define dbg_printk(format, arg...) \ |
112 | printk(pr_fmt(format), ##arg); | 109 | printk(pr_fmt(format), ##arg); |
@@ -415,8 +412,6 @@ struct driver_data { | |||
415 | 412 | ||
416 | atomic_t resumeflag; /* Atomic variable to track suspend/resume */ | 413 | atomic_t resumeflag; /* Atomic variable to track suspend/resume */ |
417 | 414 | ||
418 | atomic_t eh_active; /* Flag for error handling tracking */ | ||
419 | |||
420 | struct task_struct *mtip_svc_handler; /* task_struct of svc thd */ | 415 | struct task_struct *mtip_svc_handler; /* task_struct of svc thd */ |
421 | }; | 416 | }; |
422 | 417 | ||
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 3fd31dec8c9c..a6278e7e61a0 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -380,6 +380,7 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr, | |||
380 | rbdc = __rbd_client_find(opt); | 380 | rbdc = __rbd_client_find(opt); |
381 | if (rbdc) { | 381 | if (rbdc) { |
382 | ceph_destroy_options(opt); | 382 | ceph_destroy_options(opt); |
383 | kfree(rbd_opts); | ||
383 | 384 | ||
384 | /* using an existing client */ | 385 | /* using an existing client */ |
385 | kref_get(&rbdc->kref); | 386 | kref_get(&rbdc->kref); |
@@ -406,15 +407,15 @@ done_err: | |||
406 | 407 | ||
407 | /* | 408 | /* |
408 | * Destroy ceph client | 409 | * Destroy ceph client |
410 | * | ||
411 | * Caller must hold node_lock. | ||
409 | */ | 412 | */ |
410 | static void rbd_client_release(struct kref *kref) | 413 | static void rbd_client_release(struct kref *kref) |
411 | { | 414 | { |
412 | struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); | 415 | struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); |
413 | 416 | ||
414 | dout("rbd_release_client %p\n", rbdc); | 417 | dout("rbd_release_client %p\n", rbdc); |
415 | spin_lock(&node_lock); | ||
416 | list_del(&rbdc->node); | 418 | list_del(&rbdc->node); |
417 | spin_unlock(&node_lock); | ||
418 | 419 | ||
419 | ceph_destroy_client(rbdc->client); | 420 | ceph_destroy_client(rbdc->client); |
420 | kfree(rbdc->rbd_opts); | 421 | kfree(rbdc->rbd_opts); |
@@ -427,7 +428,9 @@ static void rbd_client_release(struct kref *kref) | |||
427 | */ | 428 | */ |
428 | static void rbd_put_client(struct rbd_device *rbd_dev) | 429 | static void rbd_put_client(struct rbd_device *rbd_dev) |
429 | { | 430 | { |
431 | spin_lock(&node_lock); | ||
430 | kref_put(&rbd_dev->rbd_client->kref, rbd_client_release); | 432 | kref_put(&rbd_dev->rbd_client->kref, rbd_client_release); |
433 | spin_unlock(&node_lock); | ||
431 | rbd_dev->rbd_client = NULL; | 434 | rbd_dev->rbd_client = NULL; |
432 | rbd_dev->client = NULL; | 435 | rbd_dev->client = NULL; |
433 | } | 436 | } |