Re: [PATCH 14/19] mm, swap: sanitize swap entry management workflow

From: Kairui Song

Date: Thu Oct 30 2025 - 01:25:42 EST


On Thu, Oct 30, 2025 at 3:30 AM kernel test robot <lkp@xxxxxxxxx> wrote:
>
> Hi Kairui,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on f30d294530d939fa4b77d61bc60f25c4284841fa]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Kairui-Song/mm-swap-rename-__read_swap_cache_async-to-swap_cache_alloc_folio/20251030-000506
> base: f30d294530d939fa4b77d61bc60f25c4284841fa
> patch link: https://lore.kernel.org/r/20251029-swap-table-p2-v1-14-3d43f3b6ec32%40tencent.com
> patch subject: [PATCH 14/19] mm, swap: sanitize swap entry management workflow
> config: i386-allnoconfig (https://download.01.org/0day-ci/archive/20251030/202510300316.UL4gxAlC-lkp@xxxxxxxxx/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251030/202510300316.UL4gxAlC-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202510300316.UL4gxAlC-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> In file included from mm/vmscan.c:70:
> mm/swap.h: In function 'swap_cache_add_folio':
> mm/swap.h:465:1: warning: no return statement in function returning non-void [-Wreturn-type]
> 465 | }
> | ^
> mm/vmscan.c: In function 'shrink_folio_list':
> >> mm/vmscan.c:1298:37: error: too few arguments to function 'folio_alloc_swap'
> 1298 | if (folio_alloc_swap(folio)) {
> | ^~~~~~~~~~~~~~~~
> mm/swap.h:388:19: note: declared here
> 388 | static inline int folio_alloc_swap(struct folio *folio, gfp_t gfp)
> | ^~~~~~~~~~~~~~~~
> mm/vmscan.c:1314:45: error: too few arguments to function 'folio_alloc_swap'
> 1314 | if (folio_alloc_swap(folio))
> | ^~~~~~~~~~~~~~~~
> mm/swap.h:388:19: note: declared here
> 388 | static inline int folio_alloc_swap(struct folio *folio, gfp_t gfp)
> | ^~~~~~~~~~~~~~~~
> --
> In file included from mm/shmem.c:44:
> mm/swap.h: In function 'swap_cache_add_folio':
> mm/swap.h:465:1: warning: no return statement in function returning non-void [-Wreturn-type]
> 465 | }
> | ^
> mm/shmem.c: In function 'shmem_writeout':
> >> mm/shmem.c:1649:14: error: too few arguments to function 'folio_alloc_swap'
> 1649 | if (!folio_alloc_swap(folio)) {
> | ^~~~~~~~~~~~~~~~
> mm/swap.h:388:19: note: declared here
> 388 | static inline int folio_alloc_swap(struct folio *folio, gfp_t gfp)
> | ^~~~~~~~~~~~~~~~
>

Thanks, I forgot to update the empty place holder for folio_alloc_swap
during rebase:

diff --git a/mm/swap.h b/mm/swap.h
index 74c61129d7b7..9aa99061573a 100644
--- a/mm/swap.h
+++ b/mm/swap.h
@@ -385,7 +385,7 @@ static inline struct swap_info_struct
*__swap_entry_to_info(swp_entry_t entry)
return NULL;
}

-static inline int folio_alloc_swap(struct folio *folio, gfp_t gfp)
+static inline int folio_alloc_swap(struct folio *folio)
{
return -EINVAL;
}