Commit a5b6244c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'block-6.8-2024-02-10' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

 - NVMe pull request via Keith:
     - Update a potentially stale firmware attribute (Maurizio)
     - Fixes for the recent verbose error logging (Keith, Chaitanya)
     - Protection information payload size fix for passthrough (Francis)

 - Fix for a queue freezing issue in virtblk (Yi)

 - blk-iocost underflow fix (Tejun)

 - blk-wbt task detection fix (Jan)

* tag 'block-6.8-2024-02-10' of git://git.kernel.dk/linux:
  virtio-blk: Ensure no requests in virtqueues before deleting vqs.
  blk-iocost: Fix an UBSAN shift-out-of-bounds warning
  nvme: use ns->head->pi_size instead of t10_pi_tuple structure size
  nvme-core: fix comment to reflect right functions
  nvme: move passthrough logging attribute to head
  blk-wbt: Fix detection of dirty-throttled tasks
  nvme-host: fix the updating of the firmware version
parents a38ff5bb 5f63a493
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1353,6 +1353,13 @@ static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now)

	lockdep_assert_held(&iocg->waitq.lock);

	/*
	 * If the delay is set by another CPU, we may be in the past. No need to
	 * change anything if so. This avoids decay calculation underflow.
	 */
	if (time_before64(now->now, iocg->delay_at))
		return false;

	/* calculate the current delay in effect - 1/2 every second */
	tdelta = now->now - iocg->delay_at;
	if (iocg->delay)
+2 −2
Original line number Diff line number Diff line
@@ -163,9 +163,9 @@ static void wb_timestamp(struct rq_wb *rwb, unsigned long *var)
 */
static bool wb_recent_wait(struct rq_wb *rwb)
{
	struct bdi_writeback *wb = &rwb->rqos.disk->bdi->wb;
	struct backing_dev_info *bdi = rwb->rqos.disk->bdi;

	return time_before(jiffies, wb->dirty_sleep + HZ);
	return time_before(jiffies, bdi->last_bdp_sleep + HZ);
}

static inline struct rq_wait *get_rq_wait(struct rq_wb *rwb,
+4 −3
Original line number Diff line number Diff line
@@ -1593,14 +1593,15 @@ static int virtblk_freeze(struct virtio_device *vdev)
{
	struct virtio_blk *vblk = vdev->priv;

	/* Ensure no requests in virtqueues before deleting vqs. */
	blk_mq_freeze_queue(vblk->disk->queue);

	/* Ensure we don't receive any more interrupts */
	virtio_reset_device(vdev);

	/* Make sure no work handler is accessing the device. */
	flush_work(&vblk->config_work);

	blk_mq_quiesce_queue(vblk->disk->queue);

	vdev->config->del_vqs(vdev);
	kfree(vblk->vqs);

@@ -1618,7 +1619,7 @@ static int virtblk_restore(struct virtio_device *vdev)

	virtio_device_ready(vdev);

	blk_mq_unquiesce_queue(vblk->disk->queue);
	blk_mq_unfreeze_queue(vblk->disk->queue);
	return 0;
}
#endif
+8 −6
Original line number Diff line number Diff line
@@ -713,7 +713,7 @@ void nvme_init_request(struct request *req, struct nvme_command *cmd)
	if (req->q->queuedata) {
		struct nvme_ns *ns = req->q->disk->private_data;

		logging_enabled = ns->passthru_err_log_enabled;
		logging_enabled = ns->head->passthru_err_log_enabled;
		req->timeout = NVME_IO_TIMEOUT;
	} else { /* no queuedata implies admin queue */
		logging_enabled = nr->ctrl->passthru_err_log_enabled;
@@ -3696,7 +3696,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)

	ns->disk = disk;
	ns->queue = disk->queue;
	ns->passthru_err_log_enabled = false;

	if (ctrl->opts && ctrl->opts->data_digest)
		blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, ns->queue);
@@ -3762,8 +3761,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)

	/*
	 * Set ns->disk->device->driver_data to ns so we can access
	 * ns->logging_enabled in nvme_passthru_err_log_enabled_store() and
	 * nvme_passthru_err_log_enabled_show().
	 * ns->head->passthru_err_log_enabled in
	 * nvme_io_passthru_err_log_enabled_[store | show]().
	 */
	dev_set_drvdata(disk_to_dev(ns->disk), ns);

@@ -4191,6 +4190,7 @@ static bool nvme_ctrl_pp_status(struct nvme_ctrl *ctrl)
static void nvme_get_fw_slot_info(struct nvme_ctrl *ctrl)
{
	struct nvme_fw_slot_info_log *log;
	u8 next_fw_slot, cur_fw_slot;

	log = kmalloc(sizeof(*log), GFP_KERNEL);
	if (!log)
@@ -4202,13 +4202,15 @@ static void nvme_get_fw_slot_info(struct nvme_ctrl *ctrl)
		goto out_free_log;
	}

	if (log->afi & 0x70 || !(log->afi & 0x7)) {
	cur_fw_slot = log->afi & 0x7;
	next_fw_slot = (log->afi & 0x70) >> 4;
	if (!cur_fw_slot || (next_fw_slot && (cur_fw_slot != next_fw_slot))) {
		dev_info(ctrl->device,
			 "Firmware is activated after next Controller Level Reset\n");
		goto out_free_log;
	}

	memcpy(ctrl->subsys->firmware_rev, &log->frs[(log->afi & 0x7) - 1],
	memcpy(ctrl->subsys->firmware_rev, &log->frs[cur_fw_slot - 1],
		sizeof(ctrl->subsys->firmware_rev));

out_free_log:
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
	length = (io.nblocks + 1) << ns->head->lba_shift;

	if ((io.control & NVME_RW_PRINFO_PRACT) &&
	    ns->head->ms == sizeof(struct t10_pi_tuple)) {
	    (ns->head->ms == ns->head->pi_size)) {
		/*
		 * Protection information is stripped/inserted by the
		 * controller.
Loading