* [PATCH] 9p/xen: fix init sequence
@ 2024-11-19 21:16 Alexander Merritt
2024-11-21 12:00 ` Jürgen Groß
2024-11-21 12:23 ` Dominique Martinet
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Merritt @ 2024-11-19 21:16 UTC (permalink / raw)
To: v9fs, linux-kernel, xen-devel
Cc: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
Christian Schoenebeck, Simon Horman, Juergen Gross, Alex Zenla,
Alexander Merritt, Ariadne Conill
From: Alex Zenla <alex@edera.dev>
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 <alex@edera.dev>
Signed-off-by: Alexander Merritt <alexander@edera.dev>
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
---
net/9p/trans_xen.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index dfdbe1ca5338..0304e8a1616d 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -465,6 +465,7 @@ static int xen_9pfs_front_init(struct xenbus_device *dev)
goto error;
}
+ xenbus_switch_state(dev, XenbusStateInitialised);
return 0;
error_xenbus:
@@ -512,8 +513,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:
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] 9p/xen: fix init sequence
2024-11-19 21:16 [PATCH] 9p/xen: fix init sequence Alexander Merritt
@ 2024-11-21 12:00 ` Jürgen Groß
2024-11-21 12:23 ` Dominique Martinet
1 sibling, 0 replies; 4+ messages in thread
From: Jürgen Groß @ 2024-11-21 12:00 UTC (permalink / raw)
To: Alexander Merritt, v9fs, linux-kernel, xen-devel
Cc: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
Christian Schoenebeck, Simon Horman, Alex Zenla, Ariadne Conill
On 19.11.24 22:16, Alexander Merritt wrote:
> From: Alex Zenla <alex@edera.dev>
>
> 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 <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>
Juergen
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] 9p/xen: fix init sequence
2024-11-19 21:16 [PATCH] 9p/xen: fix init sequence Alexander Merritt
2024-11-21 12:00 ` Jürgen Groß
@ 2024-11-21 12:23 ` Dominique Martinet
2024-11-21 12:27 ` Juergen Gross
1 sibling, 1 reply; 4+ messages in thread
From: Dominique Martinet @ 2024-11-21 12:23 UTC (permalink / raw)
To: Alexander Merritt
Cc: v9fs, linux-kernel, xen-devel, Eric Van Hensbergen,
Latchesar Ionkov, Christian Schoenebeck, Simon Horman,
Juergen Gross, Alex Zenla, Ariadne Conill
Alexander Merritt wrote on Tue, Nov 19, 2024 at 09:16:33PM +0000:
> From: Alex Zenla <alex@edera.dev>
>
> 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.
I'm not familiar with the xen bringup so I don't understand how the
patch guarantees this -- otherend_changed calls are guaranted to be
seralized for a given frontend?
I guess that at least it guaratees that we won't restart the init
process after init's been done on our side and before the remote side
sends the ack, so if you've all tested this I'll just trust you and
Juergen's review and take it as an improvement.
Queued to 9p-next; will send this to Linus in ~1week
Thanks!
--
Dominique
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] 9p/xen: fix init sequence
2024-11-21 12:23 ` Dominique Martinet
@ 2024-11-21 12:27 ` Juergen Gross
0 siblings, 0 replies; 4+ messages in thread
From: Juergen Gross @ 2024-11-21 12:27 UTC (permalink / raw)
To: Dominique Martinet, Alexander Merritt
Cc: v9fs, linux-kernel, xen-devel, Eric Van Hensbergen,
Latchesar Ionkov, Christian Schoenebeck, Simon Horman, Alex Zenla,
Ariadne Conill
[-- Attachment #1.1.1: Type: text/plain, Size: 766 bytes --]
On 21.11.24 13:23, Dominique Martinet wrote:
> Alexander Merritt wrote on Tue, Nov 19, 2024 at 09:16:33PM +0000:
>> From: Alex Zenla <alex@edera.dev>
>>
>> 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.
>
> I'm not familiar with the xen bringup so I don't understand how the
> patch guarantees this -- otherend_changed calls are guaranted to be
> seralized for a given frontend?
Yes. They are all executed by a single kernel thread.
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-21 12:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19 21:16 [PATCH] 9p/xen: fix init sequence Alexander Merritt
2024-11-21 12:00 ` Jürgen Groß
2024-11-21 12:23 ` Dominique Martinet
2024-11-21 12:27 ` Juergen Gross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox