Re: [PATCH v2 1/4] mm/huge_memory: change folio_split_supported() to folio_check_splittable()
From: Wei Yang
Date: Sat Nov 22 2025 - 20:50:28 EST
On Fri, Nov 21, 2025 at 09:55:26PM -0500, Zi Yan wrote:
>folio_split_supported() used in try_folio_split_to_order() requires
>folio->mapping to be non NULL, but current try_folio_split_to_order() does
>not check it. There is no issue in the current code, since
>try_folio_split_to_order() is only used in truncate_inode_partial_folio(),
>where folio->mapping is not NULL.
>
>To prevent future misuse, move folio->mapping NULL check (i.e., folio is
>truncated) into folio_split_supported(). Since folio->mapping NULL check
>returns -EBUSY and folio_split_supported() == false means -EINVAL, change
>folio_split_supported() return type from bool to int and return error
>numbers accordingly. Rename folio_split_supported() to
>folio_check_splittable() to match the return type change.
>
>While at it, move is_huge_zero_folio() check and folio_test_writeback()
>check into folio_check_splittable() and add kernel-doc.
>
>Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
LGTM, Thanks
Reviewed-by: Wei Yang <richard.weiyang@xxxxxxxxx>
--
Wei Yang
Help you, Help me