Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1566728 > unrolled thread
| Started by | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| First post | 2017-01-25 17:30 +0100 |
| Last post | 2017-01-25 18:00 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] Drivers: hv: balloon: add a comment explaining fall through in hv_memory_notifier() Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-01-25 17:30 +0100
RE: [PATCH] Drivers: hv: balloon: add a comment explaining fall through in hv_memory_notifier() Stephen Hemminger <sthemmin@microsoft.com> - 2017-01-25 18:00 +0100
| From | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| Date | 2017-01-25 17:30 +0100 |
| Subject | [PATCH] Drivers: hv: balloon: add a comment explaining fall through in hv_memory_notifier() |
| Message-ID | <t3yCl-43o-1@gated-at.bofh.it> |
Coverity scan gives a warning when there is fall through in a switch
without a comment.
Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
drivers/hv/hv_balloon.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 14c3dc4..7e2479f 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -587,6 +587,12 @@ static int hv_memory_notifier(struct notifier_block *nb, unsigned long val,
spin_lock_irqsave(&dm_device.ha_lock, flags);
dm_device.num_pages_onlined += mem->nr_pages;
spin_unlock_irqrestore(&dm_device.ha_lock, flags);
+ /*
+ * Fall through - ol_waitevent needs to be completed to unblock
+ * hv_mem_hot_add() allowing it to process next requests
+ * regardless of the result of if we were able to online this
+ * block.
+ */
case MEM_CANCEL_ONLINE:
if (dm_device.ha_waiting) {
dm_device.ha_waiting = false;
--
2.9.3
[toc] | [next] | [standalone]
| From | Stephen Hemminger <sthemmin@microsoft.com> |
|---|---|
| Date | 2017-01-25 18:00 +0100 |
| Subject | RE: [PATCH] Drivers: hv: balloon: add a comment explaining fall through in hv_memory_notifier() |
| Message-ID | <t3z5o-4dK-19@gated-at.bofh.it> |
| In reply to | #1566728 |
Simpe /* fallthrough */ is enough
-----Original Message-----
From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
Sent: Wednesday, January 25, 2017 8:27 AM
To: devel@linuxdriverproject.org
Cc: linux-kernel@vger.kernel.org; KY Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Stephen Hemminger <sthemmin@microsoft.com>
Subject: [PATCH] Drivers: hv: balloon: add a comment explaining fall through in hv_memory_notifier()
Coverity scan gives a warning when there is fall through in a switch without a comment.
Reported-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
drivers/hv/hv_balloon.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 14c3dc4..7e2479f 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -587,6 +587,12 @@ static int hv_memory_notifier(struct notifier_block *nb, unsigned long val,
spin_lock_irqsave(&dm_device.ha_lock, flags);
dm_device.num_pages_onlined += mem->nr_pages;
spin_unlock_irqrestore(&dm_device.ha_lock, flags);
+ /*
+ * Fall through - ol_waitevent needs to be completed to unblock
+ * hv_mem_hot_add() allowing it to process next requests
+ * regardless of the result of if we were able to online this
+ * block.
+ */
case MEM_CANCEL_ONLINE:
if (dm_device.ha_waiting) {
dm_device.ha_waiting = false;
--
2.9.3
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web