diff options
-rw-r--r-- | block/bio.c | 1 | ||||
-rw-r--r-- | block/blk-core.c | 5 | ||||
-rw-r--r-- | block/blk-lib.c | 4 | ||||
-rw-r--r-- | block/bounce.c | 1 | ||||
-rw-r--r-- | drivers/ata/libata-core.c | 2 | ||||
-rw-r--r-- | drivers/block/floppy.c | 3 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 8 | ||||
-rw-r--r-- | include/trace/events/kyber.h | 8 |
8 files changed, 22 insertions, 10 deletions
diff --git a/block/bio.c b/block/bio.c index a50d59236b19..4f4d9884443b 100644 --- a/block/bio.c +++ b/block/bio.c | |||
@@ -605,6 +605,7 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src) | |||
605 | if (bio_flagged(bio_src, BIO_THROTTLED)) | 605 | if (bio_flagged(bio_src, BIO_THROTTLED)) |
606 | bio_set_flag(bio, BIO_THROTTLED); | 606 | bio_set_flag(bio, BIO_THROTTLED); |
607 | bio->bi_opf = bio_src->bi_opf; | 607 | bio->bi_opf = bio_src->bi_opf; |
608 | bio->bi_ioprio = bio_src->bi_ioprio; | ||
608 | bio->bi_write_hint = bio_src->bi_write_hint; | 609 | bio->bi_write_hint = bio_src->bi_write_hint; |
609 | bio->bi_iter = bio_src->bi_iter; | 610 | bio->bi_iter = bio_src->bi_iter; |
610 | bio->bi_io_vec = bio_src->bi_io_vec; | 611 | bio->bi_io_vec = bio_src->bi_io_vec; |
diff --git a/block/blk-core.c b/block/blk-core.c index ce12515f9b9b..deb56932f8c4 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -798,9 +798,8 @@ void blk_cleanup_queue(struct request_queue *q) | |||
798 | * dispatch may still be in-progress since we dispatch requests | 798 | * dispatch may still be in-progress since we dispatch requests |
799 | * from more than one contexts. | 799 | * from more than one contexts. |
800 | * | 800 | * |
801 | * No need to quiesce queue if it isn't initialized yet since | 801 | * We rely on driver to deal with the race in case that queue |
802 | * blk_freeze_queue() should be enough for cases of passthrough | 802 | * initialization isn't done. |
803 | * request. | ||
804 | */ | 803 | */ |
805 | if (q->mq_ops && blk_queue_init_done(q)) | 804 | if (q->mq_ops && blk_queue_init_done(q)) |
806 | blk_mq_quiesce_queue(q); | 805 | blk_mq_quiesce_queue(q); |
diff --git a/block/blk-lib.c b/block/blk-lib.c index e8b3bb9bf375..5f2c429d4378 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c | |||
@@ -55,9 +55,11 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, | |||
55 | return -EINVAL; | 55 | return -EINVAL; |
56 | 56 | ||
57 | while (nr_sects) { | 57 | while (nr_sects) { |
58 | unsigned int req_sects = min_t(unsigned int, nr_sects, | 58 | sector_t req_sects = min_t(sector_t, nr_sects, |
59 | bio_allowed_max_sectors(q)); | 59 | bio_allowed_max_sectors(q)); |
60 | 60 | ||
61 | WARN_ON_ONCE((req_sects << 9) > UINT_MAX); | ||
62 | |||
61 | bio = blk_next_bio(bio, 0, gfp_mask); | 63 | bio = blk_next_bio(bio, 0, gfp_mask); |
62 | bio->bi_iter.bi_sector = sector; | 64 | bio->bi_iter.bi_sector = sector; |
63 | bio_set_dev(bio, bdev); | 65 | bio_set_dev(bio, bdev); |
diff --git a/block/bounce.c b/block/bounce.c index 36869afc258c..559c55bda040 100644 --- a/block/bounce.c +++ b/block/bounce.c | |||
@@ -248,6 +248,7 @@ static struct bio *bounce_clone_bio(struct bio *bio_src, gfp_t gfp_mask, | |||
248 | return NULL; | 248 | return NULL; |
249 | bio->bi_disk = bio_src->bi_disk; | 249 | bio->bi_disk = bio_src->bi_disk; |
250 | bio->bi_opf = bio_src->bi_opf; | 250 | bio->bi_opf = bio_src->bi_opf; |
251 | bio->bi_ioprio = bio_src->bi_ioprio; | ||
251 | bio->bi_write_hint = bio_src->bi_write_hint; | 252 | bio->bi_write_hint = bio_src->bi_write_hint; |
252 | bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; | 253 | bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; |
253 | bio->bi_iter.bi_size = bio_src->bi_iter.bi_size; | 254 | bio->bi_iter.bi_size = bio_src->bi_iter.bi_size; |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 6e594644cb1d..a7f5202a4815 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4553,7 +4553,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
4553 | /* These specific Samsung models/firmware-revs do not handle LPM well */ | 4553 | /* These specific Samsung models/firmware-revs do not handle LPM well */ |
4554 | { "SAMSUNG MZMPC128HBFU-000MV", "CXM14M1Q", ATA_HORKAGE_NOLPM, }, | 4554 | { "SAMSUNG MZMPC128HBFU-000MV", "CXM14M1Q", ATA_HORKAGE_NOLPM, }, |
4555 | { "SAMSUNG SSD PM830 mSATA *", "CXM13D1Q", ATA_HORKAGE_NOLPM, }, | 4555 | { "SAMSUNG SSD PM830 mSATA *", "CXM13D1Q", ATA_HORKAGE_NOLPM, }, |
4556 | { "SAMSUNG MZ7TD256HAFV-000L9", "DXT02L5Q", ATA_HORKAGE_NOLPM, }, | 4556 | { "SAMSUNG MZ7TD256HAFV-000L9", NULL, ATA_HORKAGE_NOLPM, }, |
4557 | 4557 | ||
4558 | /* devices that don't properly handle queued TRIM commands */ | 4558 | /* devices that don't properly handle queued TRIM commands */ |
4559 | { "Micron_M500IT_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | | 4559 | { "Micron_M500IT_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index a8cfa011c284..fb23578e9a41 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -4148,10 +4148,11 @@ static int __floppy_read_block_0(struct block_device *bdev, int drive) | |||
4148 | bio.bi_end_io = floppy_rb0_cb; | 4148 | bio.bi_end_io = floppy_rb0_cb; |
4149 | bio_set_op_attrs(&bio, REQ_OP_READ, 0); | 4149 | bio_set_op_attrs(&bio, REQ_OP_READ, 0); |
4150 | 4150 | ||
4151 | init_completion(&cbdata.complete); | ||
4152 | |||
4151 | submit_bio(&bio); | 4153 | submit_bio(&bio); |
4152 | process_fd_request(); | 4154 | process_fd_request(); |
4153 | 4155 | ||
4154 | init_completion(&cbdata.complete); | ||
4155 | wait_for_completion(&cbdata.complete); | 4156 | wait_for_completion(&cbdata.complete); |
4156 | 4157 | ||
4157 | __free_page(page); | 4158 | __free_page(page); |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index c7fccbb8f554..fa6e0c3b3aa6 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -697,6 +697,12 @@ static bool scsi_end_request(struct request *req, blk_status_t error, | |||
697 | */ | 697 | */ |
698 | scsi_mq_uninit_cmd(cmd); | 698 | scsi_mq_uninit_cmd(cmd); |
699 | 699 | ||
700 | /* | ||
701 | * queue is still alive, so grab the ref for preventing it | ||
702 | * from being cleaned up during running queue. | ||
703 | */ | ||
704 | percpu_ref_get(&q->q_usage_counter); | ||
705 | |||
700 | __blk_mq_end_request(req, error); | 706 | __blk_mq_end_request(req, error); |
701 | 707 | ||
702 | if (scsi_target(sdev)->single_lun || | 708 | if (scsi_target(sdev)->single_lun || |
@@ -704,6 +710,8 @@ static bool scsi_end_request(struct request *req, blk_status_t error, | |||
704 | kblockd_schedule_work(&sdev->requeue_work); | 710 | kblockd_schedule_work(&sdev->requeue_work); |
705 | else | 711 | else |
706 | blk_mq_run_hw_queues(q, true); | 712 | blk_mq_run_hw_queues(q, true); |
713 | |||
714 | percpu_ref_put(&q->q_usage_counter); | ||
707 | } else { | 715 | } else { |
708 | unsigned long flags; | 716 | unsigned long flags; |
709 | 717 | ||
diff --git a/include/trace/events/kyber.h b/include/trace/events/kyber.h index a9834c37ac40..c0e7d24ca256 100644 --- a/include/trace/events/kyber.h +++ b/include/trace/events/kyber.h | |||
@@ -31,8 +31,8 @@ TRACE_EVENT(kyber_latency, | |||
31 | 31 | ||
32 | TP_fast_assign( | 32 | TP_fast_assign( |
33 | __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); | 33 | __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); |
34 | strlcpy(__entry->domain, domain, DOMAIN_LEN); | 34 | strlcpy(__entry->domain, domain, sizeof(__entry->domain)); |
35 | strlcpy(__entry->type, type, DOMAIN_LEN); | 35 | strlcpy(__entry->type, type, sizeof(__entry->type)); |
36 | __entry->percentile = percentile; | 36 | __entry->percentile = percentile; |
37 | __entry->numerator = numerator; | 37 | __entry->numerator = numerator; |
38 | __entry->denominator = denominator; | 38 | __entry->denominator = denominator; |
@@ -60,7 +60,7 @@ TRACE_EVENT(kyber_adjust, | |||
60 | 60 | ||
61 | TP_fast_assign( | 61 | TP_fast_assign( |
62 | __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); | 62 | __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); |
63 | strlcpy(__entry->domain, domain, DOMAIN_LEN); | 63 | strlcpy(__entry->domain, domain, sizeof(__entry->domain)); |
64 | __entry->depth = depth; | 64 | __entry->depth = depth; |
65 | ), | 65 | ), |
66 | 66 | ||
@@ -82,7 +82,7 @@ TRACE_EVENT(kyber_throttled, | |||
82 | 82 | ||
83 | TP_fast_assign( | 83 | TP_fast_assign( |
84 | __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); | 84 | __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); |
85 | strlcpy(__entry->domain, domain, DOMAIN_LEN); | 85 | strlcpy(__entry->domain, domain, sizeof(__entry->domain)); |
86 | ), | 86 | ), |
87 | 87 | ||
88 | TP_printk("%d,%d %s", MAJOR(__entry->dev), MINOR(__entry->dev), | 88 | TP_printk("%d,%d %s", MAJOR(__entry->dev), MINOR(__entry->dev), |