[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xen-blkfront: BUG_ON(info->nr_rings)
- To: <paul@xxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Thu, 11 Mar 2021 11:37:04 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FLOWvj6/I7vNuUP4n4VkxtN6WBjipND4hx9RMT1j7g4=; b=FZItxeFRSWzcVMHov77pmvyEXtbTeBeHLDeXDgzaW6YpAs+u92ep2GMQfSjhJXRMwVUJ1Txe2Zv9lcvs0U/Hf4sH4Z9TZ9E/mKaRNIS+lq+UUouqUXLhtS7HMACz4kK48p0f+5PceOgq5Uu4xp55ZRpGvg4PG0O4nK3jJ7tNjzqDgEErFPAUO6Ed7EBDzaPAW0+7C/SuOgMRUqMPD+JtskiDAZ/aZkNSpVNXEloJODSa6rfTe5EueIZqxh83VficPShtQmHdvX4uyeUFsC22O+JUS8oUxyjE3wS9sE5UnOHhEPon377Dhzxq54jZ6/v2mkWtqb+sbxWGzPwY9hFgsA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AnXGHDNjPt6aa3l+NinNv2YV2JxWZult09avUM1xQRWbor/sUqMrgMS9eZBxQLvJnb+fkhF1dAz9XZm5ewOAusdvF1Vxm8rhheJFs8JrVPrsN4WI3pkJ1QYZZiu7W3j/nWaHAitpDcBOB6jsFUl9rBcXFy3HdaQoPvZK5MUFujLe/XwYFmjEmy4qrnSa4U1GF6bqYL8FEZSe8B/EPud75QxFsm5a/pNppT09363uYgFKQvzirVhM1R9QQetsrpzwRMLFYVf6va89pMyfExAjGgOAhAjzaGuSxo0uc9fIl2i+kpLGUn2pnvDJAY3iGnUowZC0jSBmjEkDZHV55N8Ezw==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 11 Mar 2021 10:37:29 +0000
- Ironport-hdrordr: A9a23:n4OxQKsbJlwbwP9RCujudQGL7skCiYYji2hD6mlwRA09T+WxrO rrtOgH1BPylTYaUGwhn9fFA6WbXXbA7/dOj7U5FYyJGC3ronGhIo0n14vtxDX8Bzbzn9Qz6Y 5JSII7MtH5CDFB4frSyBWkEtom3dmM+L2pg+Cb9Ht2UQR2cchbjztRICzzKDwReCBtA50lGJ 2AoudGvSOnY3QLbsK9b0N1ItTrjdvNiZ7gfFo6FwcqgTP+9w+AxZzbN1yj3hkYWy5S2rtKyw n4uiHw+6nLiYDf9jbyzGnWhq4m/OfJ6twGP8CUj9hQFzOEsHfVWK1Ee5mv+A84u/uu7lFCqq i9nz4FM95o433cOkGZyCGdozXI6zol53/8xVLwuxKKyqaVNVFKabsyuatjfhTU8EYmtt1nuZ g7pF6xjJZLEQjG2B30+tmgbWAaqmOPvXEgneQP5kYvKLc2Vbk5l/15wGplVL0EHC789bk9Fv hvAMz29J9tAC2nRkGckW91zNO2WHMvWj+AX0gZo8SQlwNbhXZj0iIjtYEit0ZF0Kh4Z4hP5u zCPKgtvLZSTvUOZaY4IOsaW8O4BkHEXBqkChPfHX3XUIU8f17doZ/+57s4oMuwfoYT8Zc0kJ PdFHtFqG8bYSvVeIyz9awO1iqIbHS2XDzrxM0bzYN+oKfASL3iNjDGYEwykvGnv+4UDqTgKr iOEaMTJ8WmAXrlGI5P0QG7cYJVM2MiXMocvct+dEmJpu7NN432ps3WePveP9PWYHUZc1K6Jk FGcCn4Jc1G4EzucGT/mgLtV3TkfVG63Z8YKtmZw8EjjKw2cqFcuAkcjlq0ouuRLydZj6AwdE xiZJfukqaxo3iK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q+BC r60=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Mar 11, 2021 at 09:01:51AM +0000, Paul Durrant wrote:
> On 10/03/2021 14:58, Jason Andryuk wrote:
> > Hi,
> >
> > I was running a loop of `xl block-attach ; xl block-detach` and I
> > triggered a BUG in xen-blkfront, drivers/block/xen-blkfront.c:1917
> > This is BUG_ON(info->nr_rings) in negotiate_mq called by blkback_changed.
> >
> > I'm using Linux 5.4.103 and blktap3 on Xen 4.12 (OpenXT), though I
> > don't think that matters. The backtrace and some preceding logs (from
> > the reproducer) are below.
> >
> > I just repro-ed with this:
> > path=<backend path/state>
> > xenstore-write $path 5 ; xenstore-write $path 4
> >
> > info->nr_rings is still set because of the unexpected transition
> > XenbusStateClosing -> XenbusStateConnected:
> > dom7: [ 2866.574853] vbd vbd-51728: blkfront:blkback_changed to state 5.
> > dom7: [ 2866.578385] vbd vbd-51728: blkfront:blkback_changed to state 4.
> >
> > I'm not totally sure how to handle this. The XenbusStateConnected
> > event should be creating a new blkfront device, but instead it's seen
> > by the old one which hasn't been cleaned up yet.
IIRC xenbus state changes (like you perform above) never trigger the
creation or destruction of devices on the bus. See
xenbus_otherend_changed.
xl block-detach however should indeed remove the device. We should add
an option to `xl block-detach -w` to wait for the device to actually
be removed before returning (or exit with a timeout).
> >
>
> Sounds like blkfront needs to be fixed. Once it is in state 5 the only state
> it should go to should be 6. From there it can cycle back to 4.
Indeed, there's likely some logic to be improved in blkfront so it
doesn't get messed up so badly on state changes by blkback.
I'm happy to review patch for both blkfront and libxl/xl in order to
make this better :).
Thanks, Roger.
|