From: Chen Wandun chenwandun@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I645JI
-------------------------------
This patch fix kabi problem introduced by commit ("mm/swapfile:use percpu_ref to serialize against concurrent swapoff").
Considering swap_info_struct is referenced by pointer and dont use in third module, so use KABI_EXTEND for two new member variables in swap_info_struct. Besides, dont remove unused enum value SWP_VALID, avoid unnecessary undefined alarms.
Signed-off-by: Chen Wandun chenwandun@huawei.com Reviewed-by: Kefeng Wangwangkefeng.wang@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/swap.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/linux/swap.h b/include/linux/swap.h index a65f3283ac05..b201a859ed7d 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -187,6 +187,7 @@ enum { SWP_PAGE_DISCARD = (1 << 10), /* freed swap page-cluster discards */ SWP_STABLE_WRITES = (1 << 11), /* no overwrite PG_writeback pages */ SWP_SYNCHRONOUS_IO = (1 << 12), /* synchronous IO is efficient */ + SWP_VALID = (1 << 13), /* swap is valid to be operated on? */ /* add others here before... */ SWP_SCANNING = (1 << 14), /* refcount in scan_swap_map */ }; @@ -249,7 +250,6 @@ struct swap_cluster_list { * The in-memory structure used to track swap areas. */ struct swap_info_struct { - struct percpu_ref users; /* indicate and keep swap device valid. */ unsigned long flags; /* SWP_USED etc: see above */ signed short prio; /* swap priority of this type */ struct plist_node list; /* entry in swap_active_head */ @@ -270,7 +270,6 @@ struct swap_info_struct { struct block_device *bdev; /* swap device or bdev of swap file */ struct file *swap_file; /* seldom referenced */ unsigned int old_block_size; /* seldom referenced */ - struct completion comp; /* seldom referenced */ #ifdef CONFIG_FRONTSWAP unsigned long *frontswap_map; /* frontswap in-use, one bit per page */ atomic_t frontswap_pages; /* frontswap pages in-use counter */ @@ -296,6 +295,8 @@ struct swap_info_struct { struct swap_cluster_list discard_clusters; /* discard clusters list */ KABI_RESERVE(1) KABI_RESERVE(2) + KABI_EXTEND(struct percpu_ref users) /* indicate and keep swap device valid. */ + KABI_EXTEND(struct completion comp) /* seldom referenced */ struct plist_node avail_lists[]; /* * entries in swap_avail_heads, one * entry per node.