Skip to content

Commit 7ef3ae8

Browse files
azenlamartinetd
authored andcommitted
9p/xen: fix init sequence
Large amount of mount hangs observed during hotplugging of 9pfs devices. The 9pfs Xen driver attempts to initialize itself more than once, causing the frontend and backend to disagree: the backend listens on a channel that the frontend does not send on, resulting in stalled processing. Only allow initialization of 9p frontend once. Fixes: c15fe55 ("9p/xen: fix connection sequence") Signed-off-by: Alex Zenla <alex@edera.dev> Signed-off-by: Alexander Merritt <alexander@edera.dev> Signed-off-by: Ariadne Conill <ariadne@ariadne.space> Reviewed-by: Juergen Gross <jgross@suse.com> Message-ID: <20241119211633.38321-1-alexander@edera.dev> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent ff10608 commit 7ef3ae8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

net/9p/trans_xen.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ static int xen_9pfs_front_init(struct xenbus_device *dev)
465465
goto error;
466466
}
467467

468+
xenbus_switch_state(dev, XenbusStateInitialised);
468469
return 0;
469470

470471
error_xenbus:
@@ -512,8 +513,10 @@ static void xen_9pfs_front_changed(struct xenbus_device *dev,
512513
break;
513514

514515
case XenbusStateInitWait:
515-
if (!xen_9pfs_front_init(dev))
516-
xenbus_switch_state(dev, XenbusStateInitialised);
516+
if (dev->state != XenbusStateInitialising)
517+
break;
518+
519+
xen_9pfs_front_init(dev);
517520
break;
518521

519522
case XenbusStateConnected:

0 commit comments

Comments
 (0)