From: sashiko-bot@kernel.org
To: "Zhu Jun" <zhujun2@cmss.chinamobile.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: myrs: Put the SCSI device after logging a physical event
Date: Thu, 12 Nov 2026 07:25:05 +0000 [thread overview]
Message-ID: <sashiko-outbox-210601@kernel.org> (raw)
In-Reply-To: <20261112071752.154639-1-zhujun2@cmss.chinamobile.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] scsi: myrs: silent drop of physical device events in
myrs_log_event() [1]
--
commit ac88587479e352e8cedb430c156919340b859e81
Author: Zhu Jun <zhujun2@cmss.chinamobile.com>
scsi: myrs: Put the SCSI device after logging a physical event
This commit calls scsi_device_put() in myrs_log_event() to release the
SCSI device reference acquired via scsi_device_lookup() when handling a
physical device event.
> diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
> index 1192b01fab8ec..1f248501a611f 100644
> --- a/drivers/scsi/myrs.c
> +++ b/drivers/scsi/myrs.c
> @@ -877,6 +877,8 @@ static void myrs_log_event(struct myrs_hba *cs, struct myrs_event *ev)
> break;
> }
> }
> + if (sdev)
> + scsi_device_put(sdev);
> break;
> case 'L':
> shost_printk(KERN_INFO, shost,
[Severity: Medium]
This problem wasn't introduced by this patch, but does myrs_log_event()
silently drop physical device events [1] when scsi_device_lookup()
returns NULL?
drivers/scsi/myrs.c:myrs_log_event() {
...
case 'P':
sdev = scsi_device_lookup(shost, ev->channel,
ev->target, 0);
sdev_printk(KERN_INFO, sdev, "event %d: Physical Device %s\n",
ev->ev_seq, ev_msg);
...
}
When a physical drive is hidden by the controller, unconfigured, or
already removed, scsi_device_lookup() returns NULL. Because sdev_printk()
-> sdev_prefix_printk() returns immediately when sdev is NULL instead of
falling back to shost_printk(), drive failure and removal events are never
logged.
[1] https://sashiko.dev/#/bug/linux-5aadc823-d60c-4405-bf84-45e4ed87504d
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112071752.154639-1-zhujun2@cmss.chinamobile.com?part=1
prev parent reply other threads:[~2026-11-12 7:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 7:17 [PATCH] scsi: myrs: Put the SCSI device after logging a physical event Zhu Jun
2026-11-12 7:25 ` sashiko-bot [this message]
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-210601@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zhujun2@cmss.chinamobile.com \
/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.