Blob Blame History Raw
From: Vlastimil Babka <vbabka@suse.cz>
Subject: mm, swap: fix race between swap count continuation operations - KABI fix
References: VM Functionality, bsc#1097373
Patch-mainline: Never, kABI

The backported commit 2628bd6fc052bd85e9864dae4de494d8a6313391 adds a
cont_lock field to struct swap_info_struct, which breaks KABI. Move it to the
end of structure and hide before KABI checker. This is OK, as the field is
only accessed by core functions, and modules also shouldn't be concerned with
the structure's size.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

---
 include/linux/swap.h |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -264,12 +264,14 @@ struct swap_info_struct {
 					 * both locks need hold, hold swap_lock
 					 * first.
 					 */
+	struct work_struct discard_work; /* discard worker */
+	struct swap_cluster_list discard_clusters; /* discard clusters list */
+#ifndef __GENKSYMS__
 	spinlock_t cont_lock;		/*
 					 * protect swap count continuation page
 					 * list.
 					 */
-	struct work_struct discard_work; /* discard worker */
-	struct swap_cluster_list discard_clusters; /* discard clusters list */
+#endif
 };
 
 /* linux/mm/workingset.c */