From: Bart Van Assche <bvanassche@acm.org>
To: John Garry <john.g.garry@oracle.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Mike Christie <michael.christie@oracle.com>,
Ming Lei <ming.lei@redhat.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>
Subject: Re: [PATCH] scsi: core: Report error list information in debugfs
Date: Tue, 22 Aug 2023 08:25:40 -0700 [thread overview]
Message-ID: <9c32fc0f-b14e-9f7d-7ebc-11c0710d6365@acm.org> (raw)
In-Reply-To: <36f46807-2cc0-1efd-b900-54bcaa0cba15@oracle.com>
On 8/22/23 02:04, John Garry wrote:
> If it's on the first list, then there is not much point in checking this list.
> It might be even worth checking list_empty(&cmd->eh_entry) initially also to
> save the bother.
>
> Having said all this, adding those checks will add lots of unpleasant indentation...
Since the above code is only used to export information through debugfs I don't
think that it should be optimized heavily? Anyway, how about combining the
(untested) patch below with the above patch?
diff --git a/drivers/scsi/scsi_debugfs.c b/drivers/scsi/scsi_debugfs.c
index a9bc5f7ce745..f795848b316c 100644
--- a/drivers/scsi/scsi_debugfs.c
+++ b/drivers/scsi/scsi_debugfs.c
@@ -45,15 +45,16 @@ void scsi_show_rq(struct seq_file *m, struct request *rq)
list_for_each_entry(cmd2, &shost->eh_abort_list, eh_entry) {
if (cmd == cmd2) {
list_info = "on eh_abort_list";
- break;
+ goto unlock;
}
}
list_for_each_entry(cmd2, &shost->eh_cmd_q, eh_entry) {
if (cmd == cmd2) {
list_info = "on eh_cmd_q";
- break;
+ goto unlock;
}
}
+unlock:
spin_unlock_irq(shost->host_lock);
__scsi_format_command(buf, sizeof(buf), cmd->cmnd, cmd->cmd_len);
Thanks,
Bart.
next prev parent reply other threads:[~2023-08-22 15:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 20:41 [PATCH] scsi: core: Report error list information in debugfs Bart Van Assche
2023-08-22 5:52 ` Damien Le Moal
2023-08-22 9:04 ` John Garry
2023-08-22 15:25 ` Bart Van Assche [this message]
2023-08-22 16:24 ` John Garry
2023-10-09 7:12 ` Hannes Reinecke
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=9c32fc0f-b14e-9f7d-7ebc-11c0710d6365@acm.org \
--to=bvanassche@acm.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=john.g.garry@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=ming.lei@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox