From: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
To: "ming.lei-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
<ming.lei-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"jthumshirn-l3A5Bk7waGM@public.gmane.org"
<jthumshirn-l3A5Bk7waGM@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org"
<jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"hch-jcswGhMUV9g@public.gmane.org"
<hch-jcswGhMUV9g@public.gmane.org>,
"martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org"
<martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
"axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org"
<axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
"linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"hare-IBi9RG/b67k@public.gmane.org"
<hare-IBi9RG/b67k@public.gmane.org>,
"dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
<dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v2 3/4] scsi: Avoid that .queuecommand() gets called for a quiesced SCSI device
Date: Fri, 12 Jan 2018 22:45:57 +0000 [thread overview]
Message-ID: <1515797155.2396.86.camel@wdc.com> (raw)
In-Reply-To: <20180111022341.GA7290-1Cy0MwPVgsaKEAUSAb389g@public.gmane.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1726 bytes --]
On Thu, 2018-01-11 at 10:23 +0800, Ming Lei wrote:
> > not sufficient to prevent .queuecommand() calls from scsi_send_eh_cmnd().
>
> Given it is error handling, do we need to prevent the .queuecommand() call
> in scsi_send_eh_cmnd()? Could you share us what the actual issue
> observed is from user view?
Please have a look at the kernel bug report in the description of patch 4/4 of
this series.
> > Hence surround the .queuecommand() call from the SCSI error handler with
> > blk_start_wait_if_quiesced() / blk_finish_wait_if_quiesced().
> >
> > Note: converting the .queuecommand() call in scsi_send_eh_cmnd() into
> > code that calls blk_get_request(), e.g. scsi_execute_req(), is not an
> > option since scsi_send_eh_cmnd() can be called if all requests are
> > allocated and if no requests will make progress without aborting any
> > of these requests.
>
> If we need to prevent the .queuecommand() in scsi_send_eh_cmnd(), what
> do you think of the approach by requeuing the EH command via
> scsi_mq_requeue_cmd()/scsi_requeue_cmd()? And the EH request will be
> dispatched finally when the queue becomes unquiesced or the STOPPED
> is cleared.
Calling scsi_mq_requeue_cmd() would trigger scsi_mq_uninit_cmd(),
blk_mq_put_driver_tag(), blk_mq_get_driver_tag() and scsi_mq_prep_fn().
That could cause scsi_eh_scmd_add() to be called multiple times for the
same SCSI command. However, that would break one of the assumptions
scsi_eh_scmd_add() is based on, namely that that function gets called
only once per SCSI command that is in progress.
Bart. N§²æìr¸yúèØb²X¬¶Ç§vØ^)Þº{.nÇ+·¥{±Ù{ayº\x1dÊÚë,j\a¢f£¢·h»öì\x17/oSc¾Ú³9uÀ¦æåÈ&jw¨®\x03(éÝ¢j"ú\x1a¶^[m§ÿïêäz¹Þàþf£¢·h§~m
next prev parent reply other threads:[~2018-01-12 22:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 18:18 [PATCH v2 0/4] Make SCSI transport recovery more robust Bart Van Assche
[not found] ` <20180110181817.25166-1-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2018-01-10 18:18 ` [PATCH v2 1/4] blk-mq: Rename request_queue.mq_freeze_wq into mq_wq Bart Van Assche
2018-01-10 18:18 ` [PATCH v2 2/4] block: Introduce blk_start_wait_if_quiesced() and blk_finish_wait_if_quiesced() Bart Van Assche
2018-01-10 18:18 ` [PATCH v2 4/4] IB/srp: Fix a sleep-in-invalid-context bug Bart Van Assche
[not found] ` <20180110181817.25166-5-bart.vanassche-Sjgp3cTcYWE@public.gmane.org>
2018-01-13 15:42 ` Ming Lei
2018-01-10 18:18 ` [PATCH v2 3/4] scsi: Avoid that .queuecommand() gets called for a quiesced SCSI device Bart Van Assche
2018-01-11 2:23 ` Ming Lei
[not found] ` <20180111022341.GA7290-1Cy0MwPVgsaKEAUSAb389g@public.gmane.org>
2018-01-12 22:45 ` Bart Van Assche [this message]
2018-01-13 15:54 ` Ming Lei
2018-01-25 17:07 ` 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=1515797155.2396.86.camel@wdc.com \
--to=bart.vanassche-sjgp3ctcywe@public.gmane.org \
--cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hare-IBi9RG/b67k@public.gmane.org \
--cc=hch-jcswGhMUV9g@public.gmane.org \
--cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=jthumshirn-l3A5Bk7waGM@public.gmane.org \
--cc=linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=ming.lei-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.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