Skip to content

Commit

Permalink
Merge tag 'block-5.8-2020-07-17' of git://git.kernel.dk/linux-block i…
Browse files Browse the repository at this point in the history
…nto master

Pull block fix from Jens Axboe:
 "Single NVMe multipath capacity fix"

* tag 'block-5.8-2020-07-17' of git://git.kernel.dk/linux-block:
  nvme: explicitly update mpath disk capacity on revalidation
  • Loading branch information
torvalds committed Jul 17, 2020
2 parents 0dd68a3 + 1f273e2 commit c9ea87d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,7 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
if (ns->head->disk) {
nvme_update_disk_info(ns->head->disk, ns, id);
blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
nvme_mpath_update_disk_size(ns->head->disk);
}
#endif
return 0;
Expand Down
13 changes: 13 additions & 0 deletions drivers/nvme/host/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,16 @@ static inline void nvme_trace_bio_complete(struct request *req,
trace_block_bio_complete(ns->head->disk->queue, req->bio);
}

static inline void nvme_mpath_update_disk_size(struct gendisk *disk)
{
struct block_device *bdev = bdget_disk(disk, 0);

if (bdev) {
bd_set_size(bdev, get_capacity(disk) << SECTOR_SHIFT);
bdput(bdev);
}
}

extern struct device_attribute dev_attr_ana_grpid;
extern struct device_attribute dev_attr_ana_state;
extern struct device_attribute subsys_attr_iopolicy;
Expand Down Expand Up @@ -679,6 +689,9 @@ static inline void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys)
static inline void nvme_mpath_start_freeze(struct nvme_subsystem *subsys)
{
}
static inline void nvme_mpath_update_disk_size(struct gendisk *disk)
{
}
#endif /* CONFIG_NVME_MULTIPATH */

#ifdef CONFIG_NVM
Expand Down

0 comments on commit c9ea87d

Please sign in to comment.