From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "bvanassche@acm.org" <bvanassche@acm.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v9 2/3] ufs: core: fix error handler process for MCQ abort
Date: Mon, 30 Sep 2024 06:45:16 +0000 [thread overview]
Message-ID: <ad352469b3a1b6efd07506fba78c8f8f7f0295b0.camel@mediatek.com> (raw)
In-Reply-To: <c014f499-1a5d-4e3a-adc1-a95a38bbe2de@acm.org>
On Sat, 2024-09-28 at 16:10 -0700, Bart Van Assche wrote:
>
> Hi Peter,
>
> Thank you for having drawn my attention to the above text. Regarding
> the code changes included in your previous email, do you agree that
> the
> completion code must not call scsi_done() if the CQE status is
> ABORTED
> and if the SCSI command has been aborted by the SCSI core since in
> this
> case calling scsi_done() could result in a use-after-free?
>
> Thanks,
>
> Bart.
Hi Bart,
I'm not quite sure what you mean. Are you suggesting that scsi_done()
should not be called in the case of a SCSI Abort? This should be
unrelated to OCS: ABORTED (MCQ), because in the case of OCS: INVALID
(SDB), scsi_done() might also be called, and calling scsi_done()
should
not cause any issues. This is because it has already been aborted
by the SCSI timeout, so the test bit(SCMD_STATE_COMPLETE) would
directly return. Below is the call flow:
scsi_done
scsi_done_internal
if (unlikely(test_and_set_bit(SCMD_STATE_COMPLETE, &cmd->state)))
return;
Thanks.
Peter
next prev parent reply other threads:[~2024-09-30 6:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 9:55 [PATCH v9 0/3] fix abort defect peter.wang
2024-09-25 9:55 ` [PATCH v9 1/3] ufs: core: fix the issue of ICU failure peter.wang
2024-09-25 9:55 ` [PATCH v9 2/3] ufs: core: fix error handler process for MCQ abort peter.wang
2024-09-25 16:49 ` Bart Van Assche
2024-09-26 3:45 ` Peter Wang (王信友)
2024-09-26 18:26 ` Bart Van Assche
2024-09-27 7:51 ` Peter Wang (王信友)
2024-09-28 23:10 ` Bart Van Assche
2024-09-30 6:45 ` Peter Wang (王信友) [this message]
2024-09-30 17:25 ` Bart Van Assche
2024-10-01 7:46 ` Peter Wang (王信友)
2024-09-25 9:55 ` [PATCH v9 3/3] ufs: core: add a quirk for MediaTek SDB mode aborted peter.wang
2024-09-25 16:56 ` Bart Van Assche
2024-09-26 3:42 ` Peter Wang (王信友)
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=ad352469b3a1b6efd07506fba78c8f8f7f0295b0.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=bvanassche@acm.org \
--cc=linux-scsi@vger.kernel.org \
/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