Corruption in xenstored tdb file?

Roger Pau Monné roger.pau at citrix.com
Tue Mar 16 11:56:47 UTC 2021


On Tue, Mar 16, 2021 at 12:06:32AM -0700, Brian Buhrow wrote:
> 	hello.  Following up on this further, it seems there may be a timing issue related to this
> after all.  If I bring up a NetBSD-5.2 VM, the VM comes up  without a problem and xennet0 works
> just as it should.  I can do this time and time again without any trouble.
> However, if I bring up a NetBSD-99.77 (current as of January 28 2021), I get the behavior I
> described in the previous message.  It's obviously some kind of race condition, since if I
> reboot the NetBSD-current VM several times, I can get it to come up with a network interface
> occasionally.  However, not enough to make it usable.  
> 	Also, since I wrote last, I updated to 12.2-release--p4, just to see if that made things
> better.  It did not.  I suspect, but don't know for sure, that the issue is that NetBSD-current
> is issuing commands on the xenbus faster than it did in NetBSD-5.  If that's true, then I think
> the problem lies with FreeBSD, as, in my view, a VM guest shouldn't be able to trigger a race
> condition in the host side of the server, which is what appears to be happening here.  
> 	Is there a way to get a trace of the communications between the domU's and the dom0 so I
> can see the differences between what NetBSD used to do  and what it does today?

So I've taken a look and it seems NetBSD now switches to the
XenbusStateInitialised state without having written some of the
configuration data required by netback. It's not clear to me whether
this is a bug in NetBSD, or a bug in FreeBSD netback. In any case
the patch below should fix it, can you apply it to your kernel
sources, recompile and test?

The above fix changes the behavior of FreeBSD netback to only try to
fetch the data when the frontend switches to the Connected state, this
seems to be inline with what Linux netback does, so in any case I
think it's a change worth making.

Thanks, Roger.
---8<---
diff --git a/sys/dev/xen/netback/netback.c b/sys/dev/xen/netback/netback.c
index 44159f60d996..29efd76430c7 100644
--- a/sys/dev/xen/netback/netback.c
+++ b/sys/dev/xen/netback/netback.c
@@ -1392,8 +1392,8 @@ xnb_frontend_changed(device_t dev, XenbusState frontend_state)
 
 	switch (frontend_state) {
 	case XenbusStateInitialising:
-		break;
 	case XenbusStateInitialised:
+		break;
 	case XenbusStateConnected:
 		xnb_connect(xnb);
 		break;



More information about the freebsd-xen mailing list