Skip to content

Commit a92c9ab

Browse files
committed
Merge tag 'block-6.4-2023-05-26' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: "A few fixes for the storage side of things: - Fix bio caching condition for passthrough IO (Anuj) - end-of-device check fix for zero sized devices (Christoph) - Update Paolo's email address - NVMe pull request via Keith with a single quirk addition - Fix regression in how wbt enablement is done (Yu) - Fix race in active queue accounting (Tian)" * tag 'block-6.4-2023-05-26' of git://git.kernel.dk/linux: NVMe: Add MAXIO 1602 to bogus nid list. block: make bio_check_eod work for zero sized devices block: fix bio-cache for passthru IO block, bfq: update Paolo's address in maintainer list blk-mq: fix race condition in active queue accounting blk-wbt: fix that wbt can't be disabled by default
2 parents 6fae912 + 9491d01 commit a92c9ab

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3536,7 +3536,7 @@ F: Documentation/filesystems/befs.rst
35363536
F: fs/befs/
35373537

35383538
BFQ I/O SCHEDULER
3539-
M: Paolo Valente <paolo.valente@linaro.org>
3539+
M: Paolo Valente <paolo.valente@unimore.it>
35403540
M: Jens Axboe <axboe@kernel.dk>
35413541
L: linux-block@vger.kernel.org
35423542
S: Maintained

block/blk-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static inline int bio_check_eod(struct bio *bio)
520520
sector_t maxsector = bdev_nr_sectors(bio->bi_bdev);
521521
unsigned int nr_sectors = bio_sectors(bio);
522522

523-
if (nr_sectors && maxsector &&
523+
if (nr_sectors &&
524524
(nr_sectors > maxsector ||
525525
bio->bi_iter.bi_sector > maxsector - nr_sectors)) {
526526
pr_info_ratelimited("%s: attempt to access beyond end of device\n"

block/blk-map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static struct bio *blk_rq_map_bio_alloc(struct request *rq,
248248
{
249249
struct bio *bio;
250250

251-
if (rq->cmd_flags & REQ_ALLOC_CACHE) {
251+
if (rq->cmd_flags & REQ_ALLOC_CACHE && (nr_vecs <= BIO_INLINE_VECS)) {
252252
bio = bio_alloc_bioset(NULL, nr_vecs, rq->cmd_flags, gfp_mask,
253253
&fs_bio_set);
254254
if (!bio)

block/blk-mq-tag.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,20 @@ void __blk_mq_tag_busy(struct blk_mq_hw_ctx *hctx)
3939
{
4040
unsigned int users;
4141

42+
/*
43+
* calling test_bit() prior to test_and_set_bit() is intentional,
44+
* it avoids dirtying the cacheline if the queue is already active.
45+
*/
4246
if (blk_mq_is_shared_tags(hctx->flags)) {
4347
struct request_queue *q = hctx->queue;
4448

45-
if (test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags))
49+
if (test_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags) ||
50+
test_and_set_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags))
4651
return;
47-
set_bit(QUEUE_FLAG_HCTX_ACTIVE, &q->queue_flags);
4852
} else {
49-
if (test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state))
53+
if (test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state) ||
54+
test_and_set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state))
5055
return;
51-
set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state);
5256
}
5357

5458
users = atomic_inc_return(&hctx->tags->active_queues);

block/blk-wbt.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -730,14 +730,16 @@ void wbt_enable_default(struct gendisk *disk)
730730
{
731731
struct request_queue *q = disk->queue;
732732
struct rq_qos *rqos;
733-
bool disable_flag = q->elevator &&
734-
test_bit(ELEVATOR_FLAG_DISABLE_WBT, &q->elevator->flags);
733+
bool enable = IS_ENABLED(CONFIG_BLK_WBT_MQ);
734+
735+
if (q->elevator &&
736+
test_bit(ELEVATOR_FLAG_DISABLE_WBT, &q->elevator->flags))
737+
enable = false;
735738

736739
/* Throttling already enabled? */
737740
rqos = wbt_rq_qos(q);
738741
if (rqos) {
739-
if (!disable_flag &&
740-
RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT)
742+
if (enable && RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT)
741743
RQWB(rqos)->enable_state = WBT_STATE_ON_DEFAULT;
742744
return;
743745
}
@@ -746,7 +748,7 @@ void wbt_enable_default(struct gendisk *disk)
746748
if (!blk_queue_registered(q))
747749
return;
748750

749-
if (queue_is_mq(q) && !disable_flag)
751+
if (queue_is_mq(q) && enable)
750752
wbt_init(disk);
751753
}
752754
EXPORT_SYMBOL_GPL(wbt_enable_default);

drivers/nvme/host/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,6 +3424,8 @@ static const struct pci_device_id nvme_id_table[] = {
34243424
.driver_data = NVME_QUIRK_BOGUS_NID, },
34253425
{ PCI_DEVICE(0x1e4B, 0x1202), /* MAXIO MAP1202 */
34263426
.driver_data = NVME_QUIRK_BOGUS_NID, },
3427+
{ PCI_DEVICE(0x1e4B, 0x1602), /* MAXIO MAP1602 */
3428+
.driver_data = NVME_QUIRK_BOGUS_NID, },
34273429
{ PCI_DEVICE(0x1cc1, 0x5350), /* ADATA XPG GAMMIX S50 */
34283430
.driver_data = NVME_QUIRK_BOGUS_NID, },
34293431
{ PCI_DEVICE(0x1dbe, 0x5236), /* ADATA XPG GAMMIX S70 */

0 commit comments

Comments
 (0)