From: "Michael S. Tsirkin" <mst@redhat.com>
To: Parav Pandit <parav@nvidia.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"virtualization@lists.linux.dev" <virtualization@lists.linux.dev>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>,
"NBU-Contact-Li Rongqing (EXTERNAL)" <lirongqing@baidu.com>,
Chaitanya Kulkarni <chaitanyak@nvidia.com>,
"xuanzhuo@linux.alibaba.com" <xuanzhuo@linux.alibaba.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"jasowang@redhat.com" <jasowang@redhat.com>,
"alok.a.tiwari@oracle.com" <alok.a.tiwari@oracle.com>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
Israel Rukshin <israelr@nvidia.com>
Subject: Re: [PATCH v5] virtio_blk: Fix disk deletion hang on device surprise removal
Date: Fri, 27 Jun 2025 08:21:16 -0400 [thread overview]
Message-ID: <20250627082048-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CY8PR12MB71958505493CE570B5C519A0DC7AA@CY8PR12MB7195.namprd12.prod.outlook.com>
On Thu, Jun 26, 2025 at 09:19:49AM +0000, Parav Pandit wrote:
>
> > From: Michael S. Tsirkin <mst@redhat.com>
> > Sent: 26 June 2025 12:04 PM
> > To: Parav Pandit <parav@nvidia.com>
> > Cc: Stefan Hajnoczi <stefanha@redhat.com>; axboe@kernel.dk;
> > virtualization@lists.linux.dev; linux-block@vger.kernel.org;
> > stable@vger.kernel.org; NBU-Contact-Li Rongqing (EXTERNAL)
> > <lirongqing@baidu.com>; Chaitanya Kulkarni <chaitanyak@nvidia.com>;
> > xuanzhuo@linux.alibaba.com; pbonzini@redhat.com;
> > jasowang@redhat.com; alok.a.tiwari@oracle.com; Max Gurtovoy
> > <mgurtovoy@nvidia.com>; Israel Rukshin <israelr@nvidia.com>
> > Subject: Re: [PATCH v5] virtio_blk: Fix disk deletion hang on device surprise
> > removal
> >
> > On Thu, Jun 26, 2025 at 06:29:09AM +0000, Parav Pandit wrote:
> > > > > > yes however this is not at all different that hotunplug right after reset.
> > > > > >
> > > > > For hotunplug after reset, we likely need a timeout handler.
> > > > > Because block driver running inside the remove() callback waiting
> > > > > for the IO,
> > > > may not get notified from driver core to synchronize ongoing remove().
> > > >
> > > >
> > > > Notified of what?
> > > Notification that surprise-removal occurred.
> > >
> > > > So is the scenario that graceful remove starts, and meanwhile a
> > > > surprise removal happens?
> > > >
> > > Right.
> >
> >
> > where is it stuck then? can you explain?
>
> I am not sure I understood the question.
>
> Let me try:
> Following scenario will hang even with the current fix:
>
> Say,
> 1. the graceful removal is ongoing in the remove() callback, where disk deletion del_gendisk() is ongoing, which waits for the requests to complete,
>
> 2. Now few requests are yet to complete, and surprise removal started.
>
> At this point, virtio block driver will not get notified by the driver core layer, because it is likely serializing remove() happening by user/driver unload and PCI hotplug driver-initiated device removal.
> So vblk driver doesn't know that device is removed, block layer is waiting for requests completions to arrive which it never gets.
> So del_gendisk() gets stuck.
>
> This needs some kind of timeout handling to improve the situation to make removal more robust.
>
> Did I answer or I didn't understand the question?
You did, thanks! How do other drivers handle this? The issue seems generic.
--
MST
next prev parent reply other threads:[~2025-06-27 12:21 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-02 2:44 [PATCH v5] virtio_blk: Fix disk deletion hang on device surprise removal Parav Pandit
2025-06-02 11:46 ` ALOK TIWARI
2025-06-18 9:29 ` Parav Pandit
2025-06-24 18:56 ` Stefan Hajnoczi
2025-06-24 19:01 ` Parav Pandit
2025-06-24 19:06 ` Michael S. Tsirkin
2025-06-24 19:11 ` Parav Pandit
2025-06-24 19:54 ` Michael S. Tsirkin
2025-06-25 2:55 ` Parav Pandit
2025-06-25 11:04 ` Michael S. Tsirkin
2025-06-25 11:08 ` Parav Pandit
2025-06-25 11:44 ` Michael S. Tsirkin
2025-06-25 19:08 ` Parav Pandit
2025-06-25 19:22 ` Michael S. Tsirkin
2025-06-26 3:26 ` Parav Pandit
2025-06-26 6:04 ` Michael S. Tsirkin
2025-06-26 6:29 ` Parav Pandit
2025-06-26 6:33 ` Michael S. Tsirkin
2025-06-26 9:19 ` Parav Pandit
2025-06-27 12:21 ` Michael S. Tsirkin [this message]
2025-06-27 14:00 ` Keith Busch
2025-06-24 19:06 ` Michael S. Tsirkin
2025-06-25 12:39 ` Michael S. Tsirkin
2025-06-25 19:01 ` Parav Pandit
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=20250627082048-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alok.a.tiwari@oracle.com \
--cc=axboe@kernel.dk \
--cc=chaitanyak@nvidia.com \
--cc=israelr@nvidia.com \
--cc=jasowang@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=mgurtovoy@nvidia.com \
--cc=parav@nvidia.com \
--cc=pbonzini@redhat.com \
--cc=stable@vger.kernel.org \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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.