diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2013-07-15 01:38:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-17 02:19:19 -0400 |
commit | ed07ec93e83ec471d365ce084e43ad90fd205903 (patch) | |
tree | 13a54d899c895549ea4b58521dbba90debbd284d /drivers/hv/hv_balloon.c | |
parent | 84672369ffb98a51d4ddf74c20a23636da3ad615 (diff) |
Drivers: hv: balloon: Fix a bug in the hot-add code
As we hot-add 128 MB chunks of memory, we wait to ensure that the memory
is onlined before attempting to hot-add the next chunk. If the udev rule for
memory hot-add is not executed within the allowed time, we would rollback the
state and abort further hot-add. Since the hot-add has succeeded and the only
failure is that the memory is not onlined within the allowed time, we should not
be rolling back the state. Fix this bug.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: Stable <stable@vger.kernel.org>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/hv_balloon.c')
-rw-r--r-- | drivers/hv/hv_balloon.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index 4c605c70ebf9..61b7351df1d4 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c | |||
@@ -562,7 +562,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, | |||
562 | struct hv_hotadd_state *has) | 562 | struct hv_hotadd_state *has) |
563 | { | 563 | { |
564 | int ret = 0; | 564 | int ret = 0; |
565 | int i, nid, t; | 565 | int i, nid; |
566 | unsigned long start_pfn; | 566 | unsigned long start_pfn; |
567 | unsigned long processed_pfn; | 567 | unsigned long processed_pfn; |
568 | unsigned long total_pfn = pfn_count; | 568 | unsigned long total_pfn = pfn_count; |
@@ -607,14 +607,11 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, | |||
607 | 607 | ||
608 | /* | 608 | /* |
609 | * Wait for the memory block to be onlined. | 609 | * Wait for the memory block to be onlined. |
610 | * Since the hot add has succeeded, it is ok to | ||
611 | * proceed even if the pages in the hot added region | ||
612 | * have not been "onlined" within the allowed time. | ||
610 | */ | 613 | */ |
611 | t = wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ); | 614 | wait_for_completion_timeout(&dm_device.ol_waitevent, 5*HZ); |
612 | if (t == 0) { | ||
613 | pr_info("hot_add memory timedout\n"); | ||
614 | has->ha_end_pfn -= HA_CHUNK; | ||
615 | has->covered_end_pfn -= processed_pfn; | ||
616 | break; | ||
617 | } | ||
618 | 615 | ||
619 | } | 616 | } |
620 | 617 | ||