Skip to content

Commit 771e7e4

Browse files
committed
Merge tag 'block-5.11-2020-12-23' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "A few stragglers in here, but mostly just straight fixes. In particular: - Set of rnbd fixes for issues around changes for the merge window (Gioh, Jack, Md Haris Iqbal) - iocost tracepoint addition (Baolin) - Copyright/maintainers update (Christoph) - Remove old blk-mq fast path CPU warning (Daniel) - loop max_part fix (Josh) - Remote IPI threaded IRQ fix (Sebastian) - dasd stable fixes (Stefan) - bcache merge window fixup and style fixup (Yi, Zheng)" * tag 'block-5.11-2020-12-23' of git://git.kernel.dk/linux-block: md/bcache: convert comma to semicolon bcache:remove a superfluous check in register_bcache block: update some copyrights block: remove a pointless self-reference in block_dev.c MAINTAINERS: add fs/block_dev.c to the block section blk-mq: Don't complete on a remote CPU in force threaded mode s390/dasd: fix list corruption of lcu list s390/dasd: fix list corruption of pavgroup group list s390/dasd: prevent inconsistent LCU device data s390/dasd: fix hanging device offline processing blk-iocost: Add iocg idle state tracepoint nbd: Respect max_part for all partition scans block/rnbd-clt: Does not request pdu to rtrs-clt block/rnbd-clt: Dynamically allocate sglist for rnbd_iu block/rnbd: Set write-back cache and fua same to the target device block/rnbd: Fix typos block/rnbd-srv: Protect dev session sysfs removal block/rnbd-clt: Fix possible memleak block/rnbd-clt: Get rid of warning regarding size argument in strlcpy blk-mq: Remove 'running from the wrong CPU' warning
2 parents 1f13d2f + 4692612 commit 771e7e4

18 files changed

Lines changed: 145 additions & 94 deletions

File tree

‎MAINTAINERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,6 +3199,7 @@ S: Maintained
31993199
T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
32003200
F: block/
32013201
F: drivers/block/
3202+
F: fs/block_dev.c
32023203
F: include/linux/blk*
32033204
F: kernel/trace/blktrace.c
32043205
F: lib/sbitmap.c

‎block/blk-iocost.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,6 +2185,9 @@ static int ioc_check_iocgs(struct ioc *ioc, struct ioc_now *now)
21852185
WEIGHT_ONE);
21862186
}
21872187

2188+
TRACE_IOCG_PATH(iocg_idle, iocg, now,
2189+
atomic64_read(&iocg->active_period),
2190+
atomic64_read(&ioc->cur_period), vtime);
21882191
__propagate_weights(iocg, 0, 0, false, now);
21892192
list_del_init(&iocg->active_list);
21902193
}

‎block/blk-mq.c‎

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,14 @@ static inline bool blk_mq_complete_need_ipi(struct request *rq)
650650
if (!IS_ENABLED(CONFIG_SMP) ||
651651
!test_bit(QUEUE_FLAG_SAME_COMP, &rq->q->queue_flags))
652652
return false;
653+
/*
654+
* With force threaded interrupts enabled, raising softirq from an SMP
655+
* function call will always result in waking the ksoftirqd thread.
656+
* This is probably worse than completing the request on a different
657+
* cache domain.
658+
*/
659+
if (force_irqthreads)
660+
return false;
653661

654662
/* same CPU or cache domain? Complete locally */
655663
if (cpu == rq->mq_ctx->cpu ||
@@ -1495,31 +1503,6 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
14951503
{
14961504
int srcu_idx;
14971505

1498-
/*
1499-
* We should be running this queue from one of the CPUs that
1500-
* are mapped to it.
1501-
*
1502-
* There are at least two related races now between setting
1503-
* hctx->next_cpu from blk_mq_hctx_next_cpu() and running
1504-
* __blk_mq_run_hw_queue():
1505-
*
1506-
* - hctx->next_cpu is found offline in blk_mq_hctx_next_cpu(),
1507-
* but later it becomes online, then this warning is harmless
1508-
* at all
1509-
*
1510-
* - hctx->next_cpu is found online in blk_mq_hctx_next_cpu(),
1511-
* but later it becomes offline, then the warning can't be
1512-
* triggered, and we depend on blk-mq timeout handler to
1513-
* handle dispatched requests to this hctx
1514-
*/
1515-
if (!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) &&
1516-
cpu_online(hctx->next_cpu)) {
1517-
printk(KERN_WARNING "run queue from wrong CPU %d, hctx %s\n",
1518-
raw_smp_processor_id(),
1519-
cpumask_empty(hctx->cpumask) ? "inactive": "active");
1520-
dump_stack();
1521-
}
1522-
15231506
/*
15241507
* We can't run the queue inline with ints disabled. Ensure that
15251508
* we catch bad users of this early.

‎block/genhd.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
33
* gendisk handling
4+
*
5+
* Portions Copyright (C) 2020 Christoph Hellwig
46
*/
57

68
#include <linux/module.h>

‎block/partitions/core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* Copyright (C) 1991-1998 Linus Torvalds
44
* Re-organised Feb 1998 Russell King
5+
* Copyright (C) 2020 Christoph Hellwig
56
*/
67
#include <linux/fs.h>
78
#include <linux/slab.h>

‎drivers/block/nbd.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ static int nbd_set_size(struct nbd_device *nbd, loff_t bytesize,
318318
blk_queue_logical_block_size(nbd->disk->queue, blksize);
319319
blk_queue_physical_block_size(nbd->disk->queue, blksize);
320320

321-
set_bit(GD_NEED_PART_SCAN, &nbd->disk->state);
321+
if (max_part)
322+
set_bit(GD_NEED_PART_SCAN, &nbd->disk->state);
322323
if (!set_capacity_and_notify(nbd->disk, bytesize >> 9))
323324
kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
324325
return 0;
@@ -1476,9 +1477,11 @@ static int nbd_open(struct block_device *bdev, fmode_t mode)
14761477
refcount_set(&nbd->config_refs, 1);
14771478
refcount_inc(&nbd->refs);
14781479
mutex_unlock(&nbd->config_lock);
1479-
set_bit(GD_NEED_PART_SCAN, &bdev->bd_disk->state);
1480+
if (max_part)
1481+
set_bit(GD_NEED_PART_SCAN, &bdev->bd_disk->state);
14801482
} else if (nbd_disconnected(nbd->config)) {
1481-
set_bit(GD_NEED_PART_SCAN, &bdev->bd_disk->state);
1483+
if (max_part)
1484+
set_bit(GD_NEED_PART_SCAN, &bdev->bd_disk->state);
14821485
}
14831486
out:
14841487
mutex_unlock(&nbd_index_mutex);

‎drivers/block/rnbd/rnbd-clt-sysfs.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ void rnbd_clt_remove_dev_symlink(struct rnbd_clt_dev *dev)
432432
* i.e. rnbd_clt_unmap_dev_store() leading to a sysfs warning because
433433
* of sysfs link already was removed already.
434434
*/
435-
if (strlen(dev->blk_symlink_name) && try_module_get(THIS_MODULE)) {
435+
if (dev->blk_symlink_name && try_module_get(THIS_MODULE)) {
436436
sysfs_remove_link(rnbd_devs_kobj, dev->blk_symlink_name);
437437
kfree(dev->blk_symlink_name);
438438
module_put(THIS_MODULE);
@@ -521,7 +521,8 @@ static int rnbd_clt_add_dev_symlink(struct rnbd_clt_dev *dev)
521521
return 0;
522522

523523
out_err:
524-
dev->blk_symlink_name[0] = '\0';
524+
kfree(dev->blk_symlink_name);
525+
dev->blk_symlink_name = NULL ;
525526
return ret;
526527
}
527528

0 commit comments

Comments
 (0)