Skip to content

Commit

Permalink
9p/xen: fix init sequence
Browse files Browse the repository at this point in the history
[ Upstream commit 7ef3ae82a6ebbf4750967d1ce43bcdb7e44ff74b ]

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: c15fe55d14b3b ("9p/xen: fix connection sequence")
Signed-off-by: Alex Zenla <[email protected]>
Signed-off-by: Alexander Merritt <[email protected]>
Signed-off-by: Ariadne Conill <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Dominique Martinet <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
azenla authored and gregkh committed Dec 5, 2024
1 parent 3947b10 commit c9a1f76
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/9p/trans_xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ static int xen_9pfs_front_init(struct xenbus_device *dev)
goto error;
}

xenbus_switch_state(dev, XenbusStateInitialised);
return 0;

error_xenbus:
Expand Down Expand Up @@ -527,8 +528,10 @@ static void xen_9pfs_front_changed(struct xenbus_device *dev,
break;

case XenbusStateInitWait:
if (!xen_9pfs_front_init(dev))
xenbus_switch_state(dev, XenbusStateInitialised);
if (dev->state != XenbusStateInitialising)
break;

xen_9pfs_front_init(dev);
break;

case XenbusStateConnected:
Expand Down

0 comments on commit c9a1f76

Please sign in to comment.