Re: [PATCH RFC v2 2/7] mm: memory_failure: Allow truncate_error_folio to return MF_DELAYED

Miaohe Lin
2026-04-07T03:55:58Z

On 2026/4/4 6:31, Lisa Wang wrote:
>> On Mon, Mar 30, 2026 at 03:02:01PM +0800, Miaohe Lin wrote:
> [...snip...]
>>> --- a/mm/memory-failure.c
>>> +++ b/mm/memory-failure.c
>>> @@ -941,6 +941,8 @@ static int truncate_error_folio(struct folio *folio, unsigned long pfn,
>>> if (mapping->a_ops->error_remove_folio) {
>>> int err = mapping->a_ops->error_remove_folio(mapping, folio);
>>>
>>> + if (err == MF_DELAYED)
>>> + return err;
>>
>> Will it be better to add a pr_info here to provide some information for users?
>>
>> Thanks.
>> .
> I think we don't need to add pr_info here; truncate_error_folio() always
> leads to action_result, which already logs the recovery status.

No strong opinion but I want to make code style more consistent with sth. like below:

if (err == MF_DELAYED)
pr_info xxx
else if (err != 0)
pr_info("%#lx: Failed to punch page: %d\n", pfn, err);
else if (!filemap_release_folio(folio, GFP_NOIO))
pr_info("%#lx: failed to release buffers\n", pfn);
else
ret = MF_RECOVERED;

Thanks.
.