Commit 6bca047e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 9ed714db 957a2b34
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -345,6 +345,7 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio,
		/* there isn't chance to merge the splitted bio */
		/* there isn't chance to merge the splitted bio */
		split->bi_opf |= REQ_NOMERGE;
		split->bi_opf |= REQ_NOMERGE;


		blkcg_bio_issue_init(split);
		bio_chain(split, *bio);
		bio_chain(split, *bio);
		trace_block_split(split, (*bio)->bi_iter.bi_sector);
		trace_block_split(split, (*bio)->bi_iter.bi_sector);
		submit_bio_noacct(*bio);
		submit_bio_noacct(*bio);
+3 −3
Original line number Original line Diff line number Diff line
@@ -3786,7 +3786,7 @@ static int nvme_add_ns_cdev(struct nvme_ns *ns)
}
}


static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
		unsigned nsid, struct nvme_ns_ids *ids)
		unsigned nsid, struct nvme_ns_ids *ids, bool is_shared)
{
{
	struct nvme_ns_head *head;
	struct nvme_ns_head *head;
	size_t size = sizeof(*head);
	size_t size = sizeof(*head);
@@ -3810,6 +3810,7 @@ static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
	head->subsys = ctrl->subsys;
	head->subsys = ctrl->subsys;
	head->ns_id = nsid;
	head->ns_id = nsid;
	head->ids = *ids;
	head->ids = *ids;
	head->shared = is_shared;
	kref_init(&head->ref);
	kref_init(&head->ref);


	if (head->ids.csi) {
	if (head->ids.csi) {
@@ -3891,12 +3892,11 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
				nsid);
				nsid);
			goto out_unlock;
			goto out_unlock;
		}
		}
		head = nvme_alloc_ns_head(ctrl, nsid, ids);
		head = nvme_alloc_ns_head(ctrl, nsid, ids, is_shared);
		if (IS_ERR(head)) {
		if (IS_ERR(head)) {
			ret = PTR_ERR(head);
			ret = PTR_ERR(head);
			goto out_unlock;
			goto out_unlock;
		}
		}
		head->shared = is_shared;
	} else {
	} else {
		ret = -EINVAL;
		ret = -EINVAL;
		if (!is_shared || !head->shared) {
		if (!is_shared || !head->shared) {
+7 −2
Original line number Original line Diff line number Diff line
@@ -2690,8 +2690,13 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
	struct pci_dev *pdev = to_pci_dev(dev->dev);
	struct pci_dev *pdev = to_pci_dev(dev->dev);


	mutex_lock(&dev->shutdown_lock);
	mutex_lock(&dev->shutdown_lock);
	if (pci_device_is_present(pdev) && pci_is_enabled(pdev)) {
	if (pci_is_enabled(pdev)) {
		u32 csts = readl(dev->bar + NVME_REG_CSTS);
		u32 csts;

		if (pci_device_is_present(pdev))
			csts = readl(dev->bar + NVME_REG_CSTS);
		else
			csts = ~0;


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