]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Drivers: hv: balloon: Do not post pressure status if interrupted
authorK. Y. Srinivasan <kys@microsoft.com>
Mon, 15 Jul 2013 05:38:12 +0000 (22:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jul 2013 06:19:19 +0000 (23:19 -0700)
When we are posting pressure status, we may get interrupted and handle
the un-balloon operation. In this case just don't post the status as we
know the pressure status is stale.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_balloon.c

index 61b7351df1d4cee0369a3951697aa50bcfd1de2a..deb5c25305aff4622ceb8f84a1598902e484a6ce 100644 (file)
@@ -975,6 +975,14 @@ static void post_status(struct hv_dynmem_device *dm)
                                dm->num_pages_ballooned +
                                compute_balloon_floor();
 
+       /*
+        * If our transaction ID is no longer current, just don't
+        * send the status. This can happen if we were interrupted
+        * after we picked our transaction ID.
+        */
+       if (status.hdr.trans_id != atomic_read(&trans_id))
+               return;
+
        vmbus_sendpacket(dm->dev->channel, &status,
                                sizeof(struct dm_status),
                                (unsigned long)NULL,