From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
James Bottomley <james.bottomley@hansenpartnership.com>,
Christoph Hellwig <hch@lst.de>,
Bart van Assche <bart.vanassche@sandisk.com>,
linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCHv5 8/8] scsi: inline command aborts
Date: Wed, 5 Apr 2017 17:05:51 +0200 [thread overview]
Message-ID: <20170405150551.GG5728@lst.de> (raw)
In-Reply-To: <1491316012-105426-9-git-send-email-hare@suse.de>
I think this also need to remove the abort_work field from
struct scsi_cmnd.
> }
>
> #ifdef CONFIG_SCSI_LOGGING
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 53e3343..2355100 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -115,11 +115,9 @@ static int scsi_host_eh_past_deadline(struct Scsi_Host *shost)
> * scmd_eh_abort_handler - Handle command aborts
> * @work: command to be aborted.
> */
> -void
> -scmd_eh_abort_handler(struct work_struct *work)
> +int
> +scmd_eh_abort_handler(struct scsi_cmnd *scmd)
> {
> - struct scsi_cmnd *scmd =
> - container_of(work, struct scsi_cmnd, abort_work.work);
> struct scsi_device *sdev = scmd->device;
> int rtn;
>
> @@ -127,42 +125,40 @@ static int scsi_host_eh_past_deadline(struct Scsi_Host *shost)
> SCSI_LOG_ERROR_RECOVERY(3,
> scmd_printk(KERN_INFO, scmd,
> "eh timeout, not aborting\n"));
> - } else {
> - SCSI_LOG_ERROR_RECOVERY(3,
> - scmd_printk(KERN_INFO, scmd,
> - "aborting command\n"));
> - rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd);
> - if (rtn == SUCCESS) {
> - set_host_byte(scmd, DID_TIME_OUT);
> - if (scsi_host_eh_past_deadline(sdev->host)) {
> - SCSI_LOG_ERROR_RECOVERY(3,
> - scmd_printk(KERN_INFO, scmd,
> - "eh timeout, not retrying "
> - "aborted command\n"));
> - } else if (!scsi_noretry_cmd(scmd) &&
> - (++scmd->retries <= scmd->allowed)) {
> - SCSI_LOG_ERROR_RECOVERY(3,
> - scmd_printk(KERN_WARNING, scmd,
> - "retry aborted command\n"));
> - scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
> - return;
> - } else {
> - SCSI_LOG_ERROR_RECOVERY(3,
> - scmd_printk(KERN_WARNING, scmd,
> - "finish aborted command\n"));
> - scsi_finish_command(scmd);
> - return;
> - }
> - } else {
> + return FAILED;
> + }
> + SCSI_LOG_ERROR_RECOVERY(3,
> + scmd_printk(KERN_INFO, scmd,
> + "aborting command\n"));
> + rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd);
> + if (rtn == SUCCESS) {
If you restructure the function anywat this could become an
early return / goto out.
prev parent reply other threads:[~2017-04-05 15:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 14:26 [PATCHv5 0/8] SCSI EH cleanup Hannes Reinecke
2017-04-04 14:26 ` [PATCHv5 1/8] scsi_error: count medium access timeout only once per EH run Hannes Reinecke
2017-04-05 15:01 ` Christoph Hellwig
2017-04-04 14:26 ` [PATCHv5 2/8] sd: Return SUCCESS in sd_eh_action() after device offline Hannes Reinecke
2017-04-05 15:01 ` Christoph Hellwig
2017-04-04 14:26 ` [PATCHv5 3/8] scsi: always send command aborts Hannes Reinecke
2017-04-05 15:02 ` Christoph Hellwig
2017-04-04 14:26 ` [PATCHv5 4/8] libsas: allow async aborts Hannes Reinecke
2017-04-04 14:26 ` [PATCHv5 5/8] scsi: make eh_eflags persistent Hannes Reinecke
2017-04-05 15:02 ` Christoph Hellwig
2017-04-04 14:26 ` [PATCHv5 6/8] scsi: make scsi_eh_scmd_add() always succeed Hannes Reinecke
2017-04-05 15:02 ` Christoph Hellwig
2017-04-04 14:26 ` [PATCHv5 7/8] scsi: make asynchronous aborts mandatory Hannes Reinecke
2017-04-05 15:03 ` Christoph Hellwig
2017-04-04 14:26 ` [PATCHv5 8/8] scsi: inline command aborts Hannes Reinecke
2017-04-05 15:05 ` Christoph Hellwig [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=20170405150551.GG5728@lst.de \
--to=hch@lst.de \
--cc=bart.vanassche@sandisk.com \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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.