Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-14 Thread Roger Pau Monné
On Fri, Sep 14, 2018 at 01:49:51PM +0200, Valentin Vidic wrote: > On Thu, Sep 13, 2018 at 05:08:00PM +0200, Roger Pau Monné wrote: > > So I have the following patch which I think might solve your issues > > while keeping the reset logic working. Would you mind giving it a try > > with your use case

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-14 Thread Valentin Vidic
On Thu, Sep 13, 2018 at 05:08:00PM +0200, Roger Pau Monné wrote: > So I have the following patch which I think might solve your issues > while keeping the reset logic working. Would you mind giving it a try > with your use case and pvgrub? Thanks for the patch. It seems to be having some problems

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-13 Thread Roger Pau Monné
On Mon, Sep 10, 2018 at 06:18:31PM +0200, Valentin Vidic wrote: > On Mon, Sep 10, 2018 at 05:00:58PM +0200, Roger Pau Monné wrote: > > I can try to take a look at this and attempt to make sure the state is > > only changed to closed in blkback _after_ the device has been > > released, but it might

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-10 Thread Valentin Vidic
On Mon, Sep 10, 2018 at 05:00:58PM +0200, Roger Pau Monné wrote: > I can try to take a look at this and attempt to make sure the state is > only changed to closed in blkback _after_ the device has been > released, but it might take me a couple of days to get you a patch. Thanks, I have two test no

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-10 Thread Roger Pau Monné
On Mon, Sep 10, 2018 at 03:22:52PM +0200, Valentin Vidic wrote: > On Mon, Sep 10, 2018 at 02:45:31PM +0200, Lars Ellenberg wrote: > > On Sat, Sep 08, 2018 at 09:34:32AM +0200, Valentin Vidic wrote: > > > On Fri, Sep 07, 2018 at 07:14:59PM +0200, Valentin Vidic wrote: > > > > In fact the first one i

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-10 Thread Valentin Vidic
On Mon, Sep 10, 2018 at 02:45:31PM +0200, Lars Ellenberg wrote: > On Sat, Sep 08, 2018 at 09:34:32AM +0200, Valentin Vidic wrote: > > On Fri, Sep 07, 2018 at 07:14:59PM +0200, Valentin Vidic wrote: > > > In fact the first one is the original code path before I modified > > > blkback. The problem i

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-10 Thread Lars Ellenberg
On Sat, Sep 08, 2018 at 09:34:32AM +0200, Valentin Vidic wrote: > On Fri, Sep 07, 2018 at 07:14:59PM +0200, Valentin Vidic wrote: > > In fact the first one is the original code path before I modified > > blkback. The problem is it gets executed async from workqueue so > > it might not always run b

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-08 Thread Valentin Vidic
On Fri, Sep 07, 2018 at 07:14:59PM +0200, Valentin Vidic wrote: > In fact the first one is the original code path before I modified > blkback. The problem is it gets executed async from workqueue so > it might not always run before the call to drbdadm secondary. As the DRBD device gets released o

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-07 Thread Valentin Vidic
On Fri, Sep 07, 2018 at 06:45:00PM +0200, Valentin Vidic wrote: > Adding a dump_stack in drbd_release gives two possible code paths, > both from xen_blkback and the first one from workqueue being the > problematic one: In fact the first one is the original code path before I modified blkback. The

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-07 Thread Valentin Vidic
On Fri, Sep 07, 2018 at 03:28:28PM +0200, Lars Ellenberg wrote: > We don't expose that, no. > But even if we did, that would not be racefree :-) > > The last (or even: any?) "close" of a block device that used to be open > for WRITE triggeres a udev "change" event, thus a udev run, > and the minim

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-07 Thread Lars Ellenberg
On Fri, Sep 07, 2018 at 02:13:48PM +0200, Valentin Vidic wrote: > On Fri, Sep 07, 2018 at 02:03:37PM +0200, Lars Ellenberg wrote: > > Very frequently it is *NOT* the "original user", that "still" holds it > > open, but udev, or something triggered-by-udev. > > > > So double-checking the udev rules

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-07 Thread Valentin Vidic
On Fri, Sep 07, 2018 at 02:03:37PM +0200, Lars Ellenberg wrote: > Very frequently it is *NOT* the "original user", that "still" holds it > open, but udev, or something triggered-by-udev. > > So double-checking the udev rules, > or the "lvm global_filter" settings may help. > You could instrument D

Re: [Xen-devel] [DRBD-user] [PATCH] xen-blkback: Switch to closed state after releasing the backing device

2018-09-07 Thread Lars Ellenberg
On Wed, Sep 05, 2018 at 06:27:56PM +0200, Valentin Vidic wrote: > On Wed, Sep 05, 2018 at 12:36:49PM +0200, Roger Pau Monné wrote: > > On Wed, Aug 29, 2018 at 08:52:14AM +0200, Valentin Vidic wrote: > > > Switching to closed state earlier can cause the block-drbd > > > script to fail with 'Device i