[PATCH v3 0/2] mm/memory: improve insert_pages() error handling

Avi Weiss posted 2 patches 4 weeks ago
mm/memory.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
[PATCH v3 0/2] mm/memory: improve insert_pages() error handling
Posted by Avi Weiss 4 weeks ago
Improve insert_pages() error handling.

The first patch simplifies error handling by initializing the error
status to zero and assigning error codes at their respective failure
sites.

The second patch returns -ENOMEM when walk_to_pmd() fails. A NULL
return from walk_to_pmd() indicates failure to allocate an upper
page-table level, so -ENOMEM is more appropriate than -EFAULT and is
consistent with the subsequent pte_alloc() failure.

Changes in v3:

* drop the walk_to_pmd() rename following review
* use the mm/memory: prefix consistently across the series
* carry review tags from v2
* rebase onto current mm-new

Link: https://lore.kernel.org/r/cover.1785847364.git.thnkslprpt@gmail.com/

Avi Weiss (2):
  mm/memory: simplify error handling in insert_pages()
  mm/memory: return -ENOMEM for page-table allocation failure in
    insert_pages()

 mm/memory.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)


base-commit: d2aad7fdcda7ae8a726926f2d6de7fe9e8ee7563
-- 
2.43.0
Re: [PATCH v3 0/2] mm/memory: improve insert_pages() error handling
Posted by David Hildenbrand (Arm) 2 weeks, 2 days ago
On 8/29/26 19:11, Avi Weiss wrote:
> Improve insert_pages() error handling.
> 
> The first patch simplifies error handling by initializing the error
> status to zero and assigning error codes at their respective failure
> sites.
> 
> The second patch returns -ENOMEM when walk_to_pmd() fails. A NULL
> return from walk_to_pmd() indicates failure to allocate an upper
> page-table level, so -ENOMEM is more appropriate than -EFAULT and is
> consistent with the subsequent pte_alloc() failure.
> 
> Changes in v3:
> 
> * drop the walk_to_pmd() rename following review
> * use the mm/memory: prefix consistently across the series
> * carry review tags from v2
> * rebase onto current mm-new

Double-checked, LGTM.
-- 
Cheers,

David