Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yehyeong Lee" <yhlee@isslab.korea.ac.kr>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 2/3] scsi: mvumi: quarantine a timed-out internal command's buffers
Date: Sun, 15 Nov 2026 12:39:43 +0000	[thread overview]
Message-ID: <sashiko-outbox-215502@kernel.org> (raw)
In-Reply-To: <20261115122153.1446810-3-yhlee@isslab.korea.ac.kr>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] scsi: mvumi: stranded mhba_dev_list entries when
  mvumi_probe_devices() aborts
--

commit b1478e67683e6d020afcb1ac3f2ae79623c98cd3
Author: Yehyeong Lee <yhlee@isslab.korea.ac.kr>

scsi: mvumi: quarantine a timed-out internal command's buffers

This commit moves the DMA buffers of timed-out internal commands onto
mhba->res_list instead of freeing them immediately, and stops the target
scan loop in mvumi_probe_devices() when an inquiry command times out.

> diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
> index 8d22d370d8608..48652640afc18 100644
> --- a/drivers/scsi/mvumi.c
> +++ b/drivers/scsi/mvumi.c
[ ... ]
> @@ -1552,6 +1584,7 @@ static int mvumi_probe_devices(struct mvumi_hba *mhba)
>  	struct mvumi_device *mv_dev = NULL;
>  	struct mvumi_cmd *cmd = NULL;
>  	int found = 0;
> +	int ret;
>  
>  	cmd = mvumi_create_internal_cmd(mhba, 64);
>  	if (!cmd)
> @@ -1564,6 +1597,11 @@ static int mvumi_probe_devices(struct mvumi_hba *mhba)
>  
>  	for (id = 0; id < maxid; id++) {
>  		wwid = mvumi_inquiry(mhba, id, cmd);
> +		/* the controller still owns this command's buffers */
> +		if (cmd->timed_out) {
> +			ret = -1;
> +			goto out;
> +		}

[Severity: Medium]
Does aborting the loop here strand struct mvumi_device entries allocated
for earlier target IDs on mhba->mhba_dev_list?

When an earlier iteration finds a new target, mvumi_probe_devices()
removes any prior entry from mhba->shost_dev_list and appends a new
struct mvumi_device to mhba->mhba_dev_list.  If a later target ID times
out and returns -1, mvumi_rescan_bus() skips draining mhba->mhba_dev_list:

drivers/scsi/mvumi.c:mvumi_rescan_bus() {
	...
		ret = mvumi_probe_devices(mhba);
		if (!ret) {
			list_for_each_entry_safe(mv_dev, dev_next,
						 &mhba->mhba_dev_list, list) {
	...
}

Because mvumi_match_devices() and mvumi_remove_devices() only inspect
mhba->shost_dev_list, a later rescan will allocate duplicate entries on
mhba->mhba_dev_list for those earlier targets or bring stale entries
online if a target disappeared in the meantime.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115122153.1446810-1-yhlee@isslab.korea.ac.kr?part=2

  reply	other threads:[~2026-11-15 12:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 12:21 [PATCH v2 0/3] scsi: mvumi: do not free or reuse buffers a timed-out command left with the device Yehyeong Lee
2026-11-15 12:21 ` [PATCH v2 1/3] scsi: mvumi: stop the controller bus-mastering before freeing its buffers Yehyeong Lee
2026-11-15 12:21 ` [PATCH v2 2/3] scsi: mvumi: quarantine a timed-out internal command's buffers Yehyeong Lee
2026-11-15 12:39   ` sashiko-bot [this message]
2026-11-15 12:21 ` [PATCH v2 3/3] scsi: mvumi: flush the event work before the host is freed Yehyeong Lee
2026-11-15 12:33   ` sashiko-bot

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=sashiko-outbox-215502@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yhlee@isslab.korea.ac.kr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox