From: sashiko-bot@kernel.org
To: "Li Chen" <me@linux.beauty>
Cc: nvdimm@lists.linux.dev
Subject: Re: [PATCH v7 11/12] nvdimm: virtio_pmem: converge broken virtqueue to -EIO
Date: Tue, 30 Jun 2026 11:50:06 +0000 [thread overview]
Message-ID: <20260630115006.948D61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260630092338.2094628-12-me@linux.beauty>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The use of `dev_err_once()` in `virtio_pmem_mark_broken()` causes a false positive error during normal device removal and permanently masks actual virtqueue failures for all subsequent devices.
--
commit eef59350d160a3f85b9b2a847d436de7706e56bd
Author: Li Chen <me@linux.beauty>
nvdimm: virtio_pmem: converge broken virtqueue to -EIO
This commit tracks a device-level broken state for the virtio pmem
request virtqueue to fail fast and wake up waiters when the queue is
broken. It unifies the handling of broken queues and synchronously fails
parent bios.
Link: https://lore.kernel.org/r/202512250116.ewtzlD0g-lkp@intel.com/
> diff --git a/drivers/nvdimm/nd_virtio.c b/drivers/nvdimm/nd_virtio.c
> --- a/drivers/nvdimm/nd_virtio.c
> +++ b/drivers/nvdimm/nd_virtio.c
[ ... ]
> +void virtio_pmem_mark_broken(struct virtio_pmem *vpmem)
> +{
> + if (!READ_ONCE(vpmem->broken)) {
> + WRITE_ONCE(vpmem->broken, true);
> + dev_err_once(&vpmem->vdev->dev, "virtqueue is broken\n");
[Severity: Medium]
Will this dev_err_once() globally mask true virtqueue failures and produce
false positive errors during normal operation?
Because dev_err_once() uses a globally static boolean, it will only print
this message once for the entire driver, rather than once per device.
> + }
> +
> + virtio_pmem_wake_inflight(vpmem);
> + virtio_pmem_wake_all_waiters(vpmem);
> +}
> +EXPORT_SYMBOL_GPL(virtio_pmem_mark_broken);
[ ... ]
> diff --git a/drivers/nvdimm/virtio_pmem.c b/drivers/nvdimm/virtio_pmem.c
> --- a/drivers/nvdimm/virtio_pmem.c
> +++ b/drivers/nvdimm/virtio_pmem.c
[ ... ]
> @@ -148,11 +150,21 @@ static void virtio_pmem_remove(struct virtio_device *vdev)
> {
> struct nvdimm_bus *nvdimm_bus = dev_get_drvdata(&vdev->dev);
> struct virtio_pmem *vpmem = vdev->priv;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&vpmem->pmem_lock, flags);
> + virtio_pmem_mark_broken(vpmem);
[Severity: Medium]
Does this unconditional call during teardown mean the first normal device
removal will trigger the one-time error log?
If a user unbinds the driver or removes a device, virtio_pmem_remove()
will call virtio_pmem_mark_broken(). This appears to log a false positive
error during expected teardown, and because it was logged via
dev_err_once(), it will silently mask any actual hardware or virtqueue
failures on other virtio-pmem devices afterwards.
> + spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
>
> - nvdimm_bus_unregister(nvdimm_bus);
> drain_workqueue(vpmem->flush_wq);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260630092338.2094628-1-me@linux.beauty?part=11
next prev parent reply other threads:[~2026-06-30 11:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 9:23 [PATCH v7 00/12] nvdimm: virtio_pmem: fix flush/request failure paths Li Chen
2026-06-30 9:23 ` [PATCH v7 01/12] nvdimm: preserve flush callback -ENOMEM Li Chen
2026-06-30 9:23 ` [PATCH v7 02/12] nvdimm: pmem: keep PREFLUSH before data writes Li Chen
2026-06-30 9:23 ` [PATCH v7 03/12] nvdimm: pmem: guard data loop for dataless bios Li Chen
2026-06-30 9:23 ` [PATCH v7 04/12] nvdimm: virtio_pmem: stop allocating child flush bio Li Chen
2026-06-30 10:28 ` sashiko-bot
2026-06-30 9:23 ` [PATCH v7 05/12] nvdimm: virtio_pmem: use GFP_NOIO for flush requests Li Chen
2026-06-30 10:42 ` sashiko-bot
2026-06-30 9:23 ` [PATCH v7 06/12] nvdimm: virtio_pmem: always wake -ENOSPC waiters Li Chen
2026-06-30 9:23 ` [PATCH v7 07/12] nvdimm: virtio_pmem: use READ_ONCE()/WRITE_ONCE() for wait flags Li Chen
2026-06-30 9:23 ` [PATCH v7 08/12] nvdimm: virtio_pmem: refcount requests for token lifetime Li Chen
2026-06-30 9:23 ` [PATCH v7 09/12] nvdimm: virtio_pmem: publish done with release/acquire Li Chen
2026-06-30 9:23 ` [PATCH v7 10/12] nvdimm: virtio_pmem: isolate DMA request buffers Li Chen
2026-06-30 9:23 ` [PATCH v7 11/12] nvdimm: virtio_pmem: converge broken virtqueue to -EIO Li Chen
2026-06-30 11:50 ` sashiko-bot [this message]
2026-06-30 9:23 ` [PATCH v7 12/12] nvdimm: virtio_pmem: drain requests in freeze Li Chen
2026-06-30 9:47 ` [PATCH v7 00/12] nvdimm: virtio_pmem: fix flush/request failure paths Pankaj Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260630115006.948D61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=me@linux.beauty \
--cc=nvdimm@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.