From: Hongfu Li <hongfu.li@linux.dev>
To: Kairui Song <ryncsn@gmail.com>
Cc: akpm@linux-foundation.org, chrisl@kernel.org,
shikemeng@huaweicloud.com, nphamcs@gmail.com,
baoquan.he@linux.dev, baohua@kernel.org, youngjun.park@lge.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Hongfu Li <lihongfu@kylinos.cn>
Subject: Re: [PATCH] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
Date: Thu, 16 Jul 2026 20:44:51 +0800 [thread overview]
Message-ID: <1d9d6fe5-3414-43c6-9073-d4d6508ac6a8@linux.dev> (raw)
In-Reply-To: <CAMgjq7BRSaueYLXa22Q=OvGj3w0wJKVA9+qF0+Z4MPtnjosw=w@mail.gmail.com>
在 2026/7/16 17:47, Kairui Song 写道:
> On Thu, Jul 16, 2026 at 4:56 PM Hongfu Li <hongfu.li@linux.dev> wrote:
>> From: Hongfu Li <lihongfu@kylinos.cn>
>>
>> The !CONFIG_SWAP stub for swap_cluster_lock() has mismatched prototype:
>> it has an extra unused irq argument and uses pgoff_t instead of unsigned
>> long for offset. All callers are under CONFIG_SWAP so the extra parameter
>> is dead.
>>
>> Sync the stub signature with the real function.
>>
>> Fixes: 8578e0c00dcf ("mm, swap: use the swap table for the swap cache and switch API")
>> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
>> ---
>> mm/swap.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/swap.h b/mm/swap.h
>> index 77d2d14eda42..2c4667662601 100644
>> --- a/mm/swap.h
>> +++ b/mm/swap.h
>> @@ -337,7 +337,7 @@ static inline unsigned int folio_swap_flags(struct folio *folio)
>> #else /* CONFIG_SWAP */
>> struct swap_iocb;
>> static inline struct swap_cluster_info *swap_cluster_lock(
>> - struct swap_info_struct *si, pgoff_t offset, bool irq)
>> + struct swap_info_struct *si, unsigned long offset)
> Thanks, nice catch. I didn't see any build failure report, it seems
> swap_cluster_lock is never used with !CONFIG_SWAP? In that case we can
> just delete this redundant declaration.
Agreed. |swap_cluster_lock| is never referenced under |!CONFIG_SWAP|, so
this
declaration is redundant. I will drop it in v2.
prev parent reply other threads:[~2026-07-16 12:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 8:51 Hongfu Li
2026-07-16 8:57 ` Baoquan He
2026-07-16 9:47 ` Kairui Song
2026-07-16 12:44 ` Hongfu Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1d9d6fe5-3414-43c6-9073-d4d6508ac6a8@linux.dev \
--to=hongfu.li@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=chrisl@kernel.org \
--cc=lihongfu@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=ryncsn@gmail.com \
--cc=shikemeng@huaweicloud.com \
--cc=youngjun.park@lge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome