Subject: Re: [PATCH v14 4/8] mm/hwpoison: return -EFAULT when copy fail in copy_mc_[user]_highpage()

From: Shuai Xue <[email-masked]>
Date: Wed, 27 May 2026 19:44:47 +0800

On 5/18/26 4:49 PM, Ruidong Tian wrote:
> From: Tong Tiangen <[email-masked]>
> 
> Currently, copy_mc_[user]_highpage() returns zero on success, or in case
> of failures, the number of bytes that weren't copied.
> 
> While tracking the number of not copied works fine for x86 and PPC, There
> are some difficulties in doing the same thing on ARM64 because there is no
> available caller-saved register in copy_page()(lib/copy_page.S) to save
> "bytes not copied", and the following copy_mc_page() will also encounter
> the same problem.
> 
> Consider the caller of copy_mc_[user]_highpage() cannot do any processing
> on the remaining data(The page has hardware errors), they only check if
> copy was succeeded or not, make the interface more generic by using an
> error code when copy fails (-EFAULT) or return zero on success.
> 
> Signed-off-by: Tong Tiangen <[email-masked]>
> Reviewed-by: Jonathan Cameron <[email-masked]>
> Reviewed-by: Mauro Carvalho Chehab <[email-masked]>

Reviewed-by: Shuai Xue <[email-masked]>
Thanks.
Shuai