Re: [PATCH v2] fs: hugetlb: simplify remove_inode_hugepages() return type

From: David Hildenbrand (arm)

Date: Wed Feb 04 2026 - 16:54:59 EST


On 2/4/26 22:47, Jiaqi Yan wrote:
When remove_inode_hugepages is introduced in
commit c86272287bc6 ("hugetlb: create remove_inode_single_folio to remove single file folio")
it used to return a boolean to indicate if it bailed out due to race with
page faults. However, since the race is already solved by [1],
remove_inode_hugepages() doesn't have any path to return false anymore.

Simplify remove_inode_hugepages() return type to void, remove the
unnecessary ret variable, and adjust the call site in
remove_inode_hugepages(). No functional change in this commit.

Changelog
=========

v2 -> v1 [2]

- Use two-tab alignment for parameters wrapped to new lines.

- Remove return type in remove_inode_hugepages()'s comment.

[1] https://lore.kernel.org/all/20220914221810.95771-10-mike.kravetz@xxxxxxxxxx
[2] https://lore.kernel.org/linux-mm/20260202233617.2350734-1-jiaqiyan@xxxxxxxxxx

Suggested-by: Jane Chu <jane.chu@xxxxxxxxxx>
Reviewed-by: Jane Chu <jane.chu@xxxxxxxxxx>
Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>
Acked-by: David Hildenbrand (arm) <david@xxxxxxxxxx>
Signed-off-by: Jiaqi Yan <jiaqiyan@xxxxxxxxxx>
---

For the future, the changelog always belongs down here, under the ---, like

Signed-off-by: Jiaqi Yan <jiaqiyan@xxxxxxxxxx>
---

Changelog
...

fs/hugetlbfs/inode.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

I think I always add another "---" above the file list, not sure if that is required.


I'm sure Andrew can fix that up when applying, thanks!

--
Cheers,

David