The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: 张翔 <hawkxiang.cpp@gmail.com>
Cc: lduncan@suse.com, cleech@redhat.com,
	ames.Bottomley@hansenpartnership.com, martin.petersen@oracle.com,
	james.smart@broadcom.com, ram.vegesna@broadcom.com,
	njavali@marvell.com, open-iscsi@googlegroups.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: libiscsi: Set expecting_cc_ua flag when stop_conn
Date: Mon, 14 Oct 2024 10:34:56 -0500	[thread overview]
Message-ID: <c84560d6-e6e2-4a88-8525-9193854f636d@oracle.com> (raw)
In-Reply-To: <CAHmG-mrmBYuxNOTVg+QUa6264isEwp53awnAcGGRwEU2bNSV3Q@mail.gmail.com>

On 10/12/24 2:55 AM, 张翔 wrote:
> 
> 
>     For commands coming from sd, then scsi_io_completion will end up calling
>     scsi_io_completion_action and seeing the UNIT_ATTENTION and will retry.
>     I'm not saying we shouldn't do a fix like you did below. Just want to
>     make sure I understand the case you describe above.
> 
>  
> For commands coming from sd, then scsi_complete calling scsi_decide_disposition to get "enum scsi_disposition", scsi_decide_disposition seeing the SAM_STAT_CHECK_CONDITION and calling scsi_check_sense function, then scsi_check_sense seeing UNIT_ATTENTION. If expecting_cc_ua == 1, scsi_check_sense return NEEDS_RETRY and scsi_complete will retry.


For sd, scsi_decide_disposition will return SUCCESS. scsi_complete will call
scsi_finish_command. In there we call the upper layer done callback, sd_done,
and it will return 0 as there are no good bytes. scsi_io_completion will
initially complete 0 bytes. If there are retries left then we call
scsi_io_completion_action which sees the UA and will retry.

  parent reply	other threads:[~2024-10-14 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11  8:18 [PATCH] scsi: libiscsi: Set expecting_cc_ua flag when stop_conn Xiang Zhang
2024-10-11 14:48 ` michael.christie
     [not found]   ` <CAHmG-mrmBYuxNOTVg+QUa6264isEwp53awnAcGGRwEU2bNSV3Q@mail.gmail.com>
2024-10-14 15:34     ` Mike Christie [this message]
2024-10-12 14:41 ` kernel test robot

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=c84560d6-e6e2-4a88-8525-9193854f636d@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=ames.Bottomley@hansenpartnership.com \
    --cc=cleech@redhat.com \
    --cc=hawkxiang.cpp@gmail.com \
    --cc=james.smart@broadcom.com \
    --cc=lduncan@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=njavali@marvell.com \
    --cc=open-iscsi@googlegroups.com \
    --cc=ram.vegesna@broadcom.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