[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix ASSERT in PdoUnplugRequest


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Durrant, Paul" <xadimgnik@xxxxxxxxx>
  • Date: Mon, 20 May 2024 09:22:33 +0100
  • Delivery-date: Mon, 20 May 2024 08:22:37 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 03/05/2024 11:34, Owen Smith wrote:
PdoUnplugRequest can be called multiple times on the same Pdo if
the child device is restarted during child device installation.
Avoid ASSERT in checked build and prevent incorrect increment of the
unplug values.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>

Acked-by: Paul Durrant <paul@xxxxxxx>

---
  src/xenvif/pdo.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/xenvif/pdo.c b/src/xenvif/pdo.c
index 46b43a9..a3ae061 100644
--- a/src/xenvif/pdo.c
+++ b/src/xenvif/pdo.c
@@ -1234,7 +1234,11 @@ PdoUnplugRequest(
  {
      NTSTATUS        status;
- ASSERT3U(Pdo->UnplugRequested, !=, Make);
+    // When a driver is restarted, PdoUnplugRequest is called again,
+    // dont increment the unplug count again.
+    if (Pdo->UnplugRequested == Make)
+        return;
+
      Pdo->UnplugRequested = Make;
status = XENBUS_UNPLUG(Acquire, &Pdo->UnplugInterface);




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.