Skip to content

Commit 6bca047

Browse files
committed
Merge tag 'block-5.19-2022-07-15' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Two NVMe fixes, and a regression fix for the core block layer from this merge window" * tag 'block-5.19-2022-07-15' of git://git.kernel.dk/linux-block: block: fix missing blkcg_bio_issue_init nvme: fix block device naming collision nvme-pci: fix freeze accounting for error handling
2 parents 9ed714d + 957a2b3 commit 6bca047

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

block/blk-merge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio,
345345
/* there isn't chance to merge the splitted bio */
346346
split->bi_opf |= REQ_NOMERGE;
347347

348+
blkcg_bio_issue_init(split);
348349
bio_chain(split, *bio);
349350
trace_block_split(split, (*bio)->bi_iter.bi_sector);
350351
submit_bio_noacct(*bio);

drivers/nvme/host/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3786,7 +3786,7 @@ static int nvme_add_ns_cdev(struct nvme_ns *ns)
37863786
}
37873787

37883788
static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
3789-
unsigned nsid, struct nvme_ns_ids *ids)
3789+
unsigned nsid, struct nvme_ns_ids *ids, bool is_shared)
37903790
{
37913791
struct nvme_ns_head *head;
37923792
size_t size = sizeof(*head);
@@ -3810,6 +3810,7 @@ static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
38103810
head->subsys = ctrl->subsys;
38113811
head->ns_id = nsid;
38123812
head->ids = *ids;
3813+
head->shared = is_shared;
38133814
kref_init(&head->ref);
38143815

38153816
if (head->ids.csi) {
@@ -3891,12 +3892,11 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
38913892
nsid);
38923893
goto out_unlock;
38933894
}
3894-
head = nvme_alloc_ns_head(ctrl, nsid, ids);
3895+
head = nvme_alloc_ns_head(ctrl, nsid, ids, is_shared);
38953896
if (IS_ERR(head)) {
38963897
ret = PTR_ERR(head);
38973898
goto out_unlock;
38983899
}
3899-
head->shared = is_shared;
39003900
} else {
39013901
ret = -EINVAL;
39023902
if (!is_shared || !head->shared) {

drivers/nvme/host/pci.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,8 +2690,13 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
26902690
struct pci_dev *pdev = to_pci_dev(dev->dev);
26912691

26922692
mutex_lock(&dev->shutdown_lock);
2693-
if (pci_device_is_present(pdev) && pci_is_enabled(pdev)) {
2694-
u32 csts = readl(dev->bar + NVME_REG_CSTS);
2693+
if (pci_is_enabled(pdev)) {
2694+
u32 csts;
2695+
2696+
if (pci_device_is_present(pdev))
2697+
csts = readl(dev->bar + NVME_REG_CSTS);
2698+
else
2699+
csts = ~0;
26952700

26962701
if (dev->ctrl.state == NVME_CTRL_LIVE ||
26972702
dev->ctrl.state == NVME_CTRL_RESETTING) {

0 commit comments

Comments
 (0)