From: Greg KH <greg@kroah.com>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: ming.lei@redhat.com, stable@vger.kernel.org, jejb@linux.ibm.com,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, yukuai3@huawei.com,
yi.zhang@huawei.com
Subject: Re: [PATCH stable 5.4] scsi: core: Fix race between handling STS_RESOURCE and completion
Date: Mon, 1 Aug 2022 10:46:11 +0200 [thread overview]
Message-ID: <YueS04RIq2gTUGgg@kroah.com> (raw)
In-Reply-To: <20220801012251.1959147-1-yukuai1@huaweicloud.com>
On Mon, Aug 01, 2022 at 09:22:51AM +0800, Yu Kuai wrote:
> From: Ming Lei <ming.lei@redhat.com>
>
> commit 673235f915318ced5d7ec4b2bfd8cb909e6a4a55 upstream.
>
> When queuing I/O request to LLD, STS_RESOURCE may be returned because:
>
> - Host is in recovery or blocked
>
> - Target queue throttling or target is blocked
>
> - LLD rejection
>
> In these scenarios BLK_STS_DEV_RESOURCE is returned to the block layer to
> avoid an unnecessary re-run of the queue. However, all of the requests
> queued to this SCSI device may complete immediately after reading
> 'sdev->device_busy' and BLK_STS_DEV_RESOURCE is returned to block layer. In
> that case the current I/O won't get a chance to get queued since it is
> invisible at that time for both scsi_run_queue_async() and blk-mq's
> RESTART.
>
> Fix the issue by not returning BLK_STS_DEV_RESOURCE in this situation.
>
> Link: https://lore.kernel.org/r/20201202100419.525144-1-ming.lei@redhat.com
> Fixes: 86ff7c2a80cd ("blk-mq: introduce BLK_STS_DEV_RESOURCE")
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: Sumit Saxena <sumit.saxena@broadcom.com>
> Cc: Kashyap Desai <kashyap.desai@broadcom.com>
> Cc: Bart Van Assche <bvanassche@acm.org>
> Cc: Ewan Milne <emilne@redhat.com>
> Cc: Long Li <longli@microsoft.com>
> Reported-by: John Garry <john.garry@huawei.com>
> Tested-by: "chenxiang (M)" <chenxiang66@hisilicon.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
> drivers/scsi/scsi_lib.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Both now queued up, thanks.
greg k-h
prev parent reply other threads:[~2022-08-01 8:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 1:22 [PATCH stable 5.4] scsi: core: Fix race between handling STS_RESOURCE and completion Yu Kuai
2022-08-01 8:46 ` Greg KH [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=YueS04RIq2gTUGgg@kroah.com \
--to=greg@kroah.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=stable@vger.kernel.org \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.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