|
| 1 | +From 8e7d925b756b09c7c52b1b06a3c3c996d9127d64 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ariadne Conill < [email protected]> |
| 3 | +Date: Mon, 8 Dec 2025 11:40:56 -0800 |
| 4 | +Subject: [PATCH] 9p/xen: mark 9p transport device as closing when removing it |
| 5 | + |
| 6 | +We need to do this so that we can signal to the other end that the |
| 7 | +device is being removed, so that it will release its claim on the |
| 8 | +underlying memory allocation. Otherwise releasing the grant-table |
| 9 | +entries is deferred resulting in a kernel oops since the pages have |
| 10 | +already been freed. |
| 11 | + |
| 12 | +Cc: Juergen Gross < [email protected]> |
| 13 | +Cc: Stefano Stabellini < [email protected]> |
| 14 | +Fixes: 71ebd71921e45 ("xen/9pfs: connect to the backend") |
| 15 | +Signed-off-by: Ariadne Conill < [email protected]> |
| 16 | +Signed-off-by: Alex Zenla < [email protected]> |
| 17 | +--- |
| 18 | + net/9p/trans_xen.c | 1 + |
| 19 | + 1 file changed, 1 insertion(+) |
| 20 | + |
| 21 | +diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c |
| 22 | +index b9ff69c7522a..cde283c42dc6 100644 |
| 23 | +--- a/net/9p/trans_xen.c |
| 24 | ++++ b/net/9p/trans_xen.c |
| 25 | +@@ -312,6 +312,7 @@ static void xen_9pfs_front_remove(struct xenbus_device *dev) |
| 26 | + { |
| 27 | + struct xen_9pfs_front_priv *priv = dev_get_drvdata(&dev->dev); |
| 28 | + |
| 29 | ++ xenbus_switch_state(dev, XenbusStateClosing); |
| 30 | + dev_set_drvdata(&dev->dev, NULL); |
| 31 | + xen_9pfs_front_free(priv); |
| 32 | + } |
| 33 | +-- |
| 34 | +2.52.0 |
| 35 | + |
0 commit comments