Skip to content

Commit

Permalink
Merge branch 'nvme-4.15' of git://git.infradead.org/nvme into for-linus
Browse files Browse the repository at this point in the history
Pull NVMe fixes from Christoph:

"Below are a couple important one or two liners fixes for Linux 4.15"
  • Loading branch information
axboe committed Dec 15, 2017
2 parents fcf38cd + 654b4a4 commit a9fa991
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ static void nvme_config_discard(struct nvme_ctrl *ctrl,
BUILD_BUG_ON(PAGE_SIZE / sizeof(struct nvme_dsm_range) <
NVME_DSM_MAX_RANGES);

queue->limits.discard_alignment = size;
queue->limits.discard_alignment = 0;
queue->limits.discard_granularity = size;

blk_queue_max_discard_sectors(queue, UINT_MAX);
Expand Down Expand Up @@ -1705,7 +1705,8 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors);
blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX));
}
if (ctrl->quirks & NVME_QUIRK_STRIPE_SIZE)
if ((ctrl->quirks & NVME_QUIRK_STRIPE_SIZE) &&
is_power_of_2(ctrl->max_hw_sectors))
blk_queue_chunk_sectors(q, ctrl->max_hw_sectors);
blk_queue_virt_boundary(q, ctrl->page_size - 1);
if (ctrl->vwc & NVME_CTRL_VWC_PRESENT)
Expand Down Expand Up @@ -2869,7 +2870,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)

blk_queue_logical_block_size(ns->queue, 1 << ns->lba_shift);
nvme_set_queue_limits(ctrl, ns->queue);
nvme_setup_streams_ns(ctrl, ns);

id = nvme_identify_ns(ctrl, nsid);
if (!id)
Expand All @@ -2880,6 +2880,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)

if (nvme_init_ns_head(ns, nsid, id, &new))
goto out_free_id;
nvme_setup_streams_ns(ctrl, ns);

#ifdef CONFIG_NVME_MULTIPATH
/*
Expand Down Expand Up @@ -2965,15 +2966,15 @@ static void nvme_ns_remove(struct nvme_ns *ns)
return;

if (ns->disk && ns->disk->flags & GENHD_FL_UP) {
if (blk_get_integrity(ns->disk))
blk_integrity_unregister(ns->disk);
nvme_mpath_remove_disk_links(ns);
sysfs_remove_group(&disk_to_dev(ns->disk)->kobj,
&nvme_ns_id_attr_group);
if (ns->ndev)
nvme_nvm_unregister_sysfs(ns);
del_gendisk(ns->disk);
blk_cleanup_queue(ns->queue);
if (blk_get_integrity(ns->disk))
blk_integrity_unregister(ns->disk);
}

mutex_lock(&ns->ctrl->subsys->lock);
Expand Down
1 change: 0 additions & 1 deletion drivers/nvme/host/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3221,7 +3221,6 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,

/* initiate nvme ctrl ref counting teardown */
nvme_uninit_ctrl(&ctrl->ctrl);
nvme_put_ctrl(&ctrl->ctrl);

/* Remove core ctrl ref. */
nvme_put_ctrl(&ctrl->ctrl);
Expand Down

0 comments on commit a9fa991

Please sign in to comment.