All of lore.kernel.org
 help / color / mirror / Atom feed
From: "chenxiang (M)" <chenxiang66@hisilicon.com>
To: "Zouming (IT)" <zouming.zouming@huawei.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"axboe@fb.com" <axboe@fb.com>
Cc: wangzhoumengjian <wangzhoumengjian@huawei.com>
Subject: Re: [bug report after v4.5-rc1]block: When the scsi device has a timeout IO, the scsi device is stuck when it is deleted
Date: Thu, 2 Nov 2017 20:33:46 +0800	[thread overview]
Message-ID: <77dc5059-a8db-6f9b-e4ee-1a65b030c9bf@hisilicon.com> (raw)
In-Reply-To: <32770656ECCC174D9F733890F5D00C0D99557B3A@dggemm511-mbs.china.huawei.com>

在 2017/11/2 20:16, Zouming (IT) 写道:
> 1.Repeat steps:
> (1) send IO on the device /dev/sdx.
> (2) Simulate an IO lost
> (3) Use the command before to  delete scsi device  before IO timeout
>        ehco 1 > /sys/class/sdx/device/delete
>
> 2.The stack of delete thead is before:
> [<ffffffff810999ef>] msleep+0x2f/0x40
> [<ffffffff812f78b4>] __blk_drain_queue+0xa4/0x170
> [<ffffffff812f7bfd>] blk_cleanup_queue+0x13d/0x150
> [<ffffffff81473d2a>] __scsi_remove_device+0x4a/0xd0
> [<ffffffff81473dd6>] scsi_remove_device+0x26/0x40
> [<ffffffff81473e05>] sdev_store_delete_callback+0x15/0x20
> [<ffffffff8127fdc4>] sysfs_schedule_callback_work+0x14/0x60
> [<ffffffff810a881a>] process_one_work+0x17a/0x440
> [<ffffffff810a94e6>] worker_thread+0x126/0x3c0
> [<ffffffff810b098f>] kthread+0xcf/0xe0
> [<ffffffff816b4f18>] ret_from_fork+0x58/0x90
>
> 3.The reason is before:
>    (1) When the scsi device is deleted, invoke blk_cleanup_queue funtion to
>          set the flag of request_queue dying, and wait all IO back.
>
>    (2) when IO timout,the timeout workqueue invoke blk_timeout_work function to abort IO,
>         but it will not abort the IO because it call  blk_queue_enter funtion
>         judge the request_queue is dying and return direct without doing anything.

Hi Zouming,
You can have a test on Bart's patch "[PATCH] block: Fix a race between 
blk_cleanup_queue() and timeout handling" for this issue.
I think this patch can solve your issue.

  reply	other threads:[~2017-11-02 12:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 12:16 [bug report after v4.5-rc1]block: When the scsi device has a timeout IO, the scsi device is stuck when it is deleted Zouming (IT)
2017-11-02 12:33 ` chenxiang (M) [this message]
2017-11-02 12:54   ` 答复: " Zouming (IT)

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=77dc5059-a8db-6f9b-e4ee-1a65b030c9bf@hisilicon.com \
    --to=chenxiang66@hisilicon.com \
    --cc=axboe@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=wangzhoumengjian@huawei.com \
    --cc=zouming.zouming@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 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.