From: Bart Van Assche <bvanassche@acm.org>
To: Mike Christie <michael.christie@oracle.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>,
linux-scsi@vger.kernel.org,
Adrian Hunter <adrian.hunter@intel.com>,
Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>,
Ming Lei <ming.lei@redhat.com>,
John Garry <john.garry@huawei.com>,
Hannes Reinecke <hare@suse.de>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH v3 1/8] scsi: core: Fix a race between scsi_done() and scsi_timeout()
Date: Thu, 29 Sep 2022 17:32:30 -0700 [thread overview]
Message-ID: <508f9526-38a6-7a06-596d-990c01b20a77@acm.org> (raw)
In-Reply-To: <8d123a46-42c0-35b7-92d6-bbbbd3abab35@oracle.com>
On 9/29/22 17:17, Mike Christie wrote:
> On 9/29/22 5:00 PM, Bart Van Assche wrote:
>> if (rtn == BLK_EH_DONE) {
>> /*
>> - * Set the command to complete first in order to prevent a real
>> - * completion from releasing the command while error handling
>> - * is using it. If the command was already completed, then the
>> - * lower level driver beat the timeout handler, and it is safe
>> - * to return without escalating error recovery.
>> - *
>> - * If timeout handling lost the race to a real completion, the
>> - * block layer may ignore that due to a fake timeout injection,
>> - * so return RESET_TIMER to allow error handling another shot
>
> I've been wondering about this code too.
>
> I think the patch is correct for the normal cases, but I didn't understand the
> old fake timeout comment case. From the comment it seemed like that was the reason
> we did the RESET_TIMER. Does that not exist anymore or was it just bogus?
Before commit 15f73f5b3e59 ("blk-mq: move failure injection out of
blk_mq_complete_request") the scsi_mq_done() function cleared the
SCMD_STATE_COMPLETE bit in case of fake timeout injection. I think
that commit made the above comment incorrect.
> The commit you referenced actually was returning BLK_EH_DONE like we want. This
> commit:
>
> commit f1342709d18af97b0e71449d5696b8873d1a456c
> Author: Keith Busch <keith.busch@intel.com>
> Date: Mon Nov 26 09:54:29 2018 -0700
>
> scsi: Do not rely on blk-mq for double completions
>
>
> changed it to BLK_EH_RESET_TIMER and changed the above comment to mention
> the fake timeout case. However, the commit message mentioned the patch was done
> because we didn't want scsi digging the block layer.
>
> If the fake injection thingy is bogus, then it seems ok to me.
Hmm ... I probably should modify the Fixes tag.
Thanks,
Bart.
next prev parent reply other threads:[~2022-09-30 0:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 22:00 [PATCH v3 0/8] Fix a deadlock in the UFS driver Bart Van Assche
2022-09-29 22:00 ` [PATCH v3 1/8] scsi: core: Fix a race between scsi_done() and scsi_timeout() Bart Van Assche
2022-09-30 0:17 ` Mike Christie
2022-09-30 0:32 ` Bart Van Assche [this message]
2022-09-29 22:00 ` [PATCH v3 2/8] scsi: core: Change the return type of .eh_timed_out() Bart Van Assche
2022-09-29 22:00 ` [PATCH v3 3/8] scsi: core: Support failing requests while recovering Bart Van Assche
2022-10-03 17:27 ` Mike Christie
2022-10-03 19:20 ` Bart Van Assche
2022-09-29 22:00 ` [PATCH v3 4/8] scsi: ufs: Remove an outdated comment Bart Van Assche
2022-09-30 10:26 ` Bean Huo
2022-10-03 5:55 ` Adrian Hunter
2022-09-29 22:00 ` [PATCH v3 5/8] scsi: ufs: Use 'else' in ufshcd_set_dev_pwr_mode() Bart Van Assche
2022-09-30 10:28 ` Bean Huo
2022-10-03 5:58 ` Adrian Hunter
2022-09-29 22:00 ` [PATCH v3 6/8] scsi: ufs: Try harder to change the power mode Bart Van Assche
2022-09-30 12:14 ` Bean Huo
2022-10-03 6:10 ` Adrian Hunter
2022-10-03 16:38 ` Bart Van Assche
2022-09-29 22:00 ` [PATCH v3 7/8] scsi: ufs: Track system suspend / resume activity Bart Van Assche
2022-10-03 6:10 ` Adrian Hunter
2022-09-29 22:00 ` [PATCH v3 8/8] scsi: ufs: Fix a deadlock between PM and the SCSI error handler Bart Van Assche
2022-09-30 15:03 ` Bean Huo
2022-09-30 17:15 ` Bart Van Assche
2022-10-02 21:21 ` Bean Huo
2022-10-04 0:21 ` Bart Van Assche
2022-10-03 6:18 ` Adrian Hunter
2022-10-03 16:45 ` Bart Van Assche
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=508f9526-38a6-7a06-596d-990c01b20a77@acm.org \
--to=bvanassche@acm.org \
--cc=adrian.hunter@intel.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jaegeuk@kernel.org \
--cc=jejb@linux.ibm.com \
--cc=john.garry@huawei.com \
--cc=kbusch@kernel.org \
--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 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.