Skip to contentSkip to conversation

virtio_balloon: fix build regression

PATCH In review Arnd Bergmann 2 participants 2 messages Nov 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio_balloon: fix build regression

The new balloon_page_push/balloon_page_pop helpers got added inside of an #ifdef, causing a build failure when CONFIG_BALLOON_COMPACTION is disabled:

drivers/virtio/virtio_balloon.c: In function 'fill_balloon':
drivers/virtio/virtio_balloon.c:164:3: error: implicit declaration of function 'balloon_page_push'

This adds another empty stub function for the case that CONFIG_BALLOON_COMPACTION is disabled.

Fixes f09517b35de8 ("virtio_balloon: fix deadlock on OOM")

---
I couldn't easily figure out whether the new functions were indeed intended to be only used when BALLOON_COMPACTION is enabled, or whether they should always be there. In case I picked the wrong one of the two, the answer would obviously be to move the definitions outside of the #ifdef, or into a different file.

---
 include/linux/balloon_compaction.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/linux/balloon_compaction.h +9 -0
index 36734ff07213..730b962fd572 100644
@@ -223,6 +223,15 @@ static inline int balloon_page_migrate(struct page *newpage,
 	return 0;
 }
 
+static inline void balloon_page_push(struct list_head *pages, struct page *page)
+{
+}
+
+static inline struct page *balloon_page_pop(struct list_head *pages)
+{
+	return NULL;
+}
+
 static inline gfp_t balloon_mapping_gfp_mask(void)
 {
 	return GFP_HIGHUSER;
Signature · 1 line
2.9.0
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The new balloon_page_push/balloon_page_pop helpers got added inside of an #ifdef, causing a build failure when CONFIG_BALLOON_COMPACTION is disabled:

drivers/virtio/virtio_balloon.c: In function 'fill_balloon':
drivers/virtio/virtio_balloon.c:164:3: error: implicit declaration of function 'balloon_page_push'

This adds another empty stub function for the case that CONFIG_BALLOON_COMPACTION is disabled.

Quoted 8 lines
Fixes f09517b35de8 ("virtio_balloon: fix deadlock on OOM")

---
I couldn't easily figure out whether the new functions were indeed intended to be only used when BALLOON_COMPACTION is enabled, or whether they should always be there. In case I picked the wrong one of the two, the answer would obviously be to move the definitions outside of the #ifdef, or into a different file.

Hmm no, I think we actually need these to work.

I'll fix it up, thanks for the report.

Quoted 26 lines
---
 include/linux/balloon_compaction.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/linux/balloon_compaction.h +9 -0
index 36734ff07213..730b962fd572 100644
@@ -223,6 +223,15 @@ static inline int balloon_page_migrate(struct page *newpage,
 	return 0;
 }
 
+static inline void balloon_page_push(struct list_head *pages, struct page *page)
+{
+}
+
+static inline struct page *balloon_page_pop(struct list_head *pages)
+{
+	return NULL;
+}
+
 static inline gfp_t balloon_mapping_gfp_mask(void)
 {
 	return GFP_HIGHUSER;
Signature · 1 line
2.9.0