[PATCH v14 4/8] mm/hwpoison: return -EFAULT when copy fail in copy_mc_[user]_highpage()
Shuai Xue
xueshuai at linux.alibaba.com
Wed May 27 04:44:47 PDT 2026
On 5/18/26 4:49 PM, Ruidong Tian wrote:
> From: Tong Tiangen <tongtiangen at huawei.com>
>
> 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 <tongtiangen at huawei.com>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron at huawei.com>
> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei at kernel.org>
Reviewed-by: Shuai Xue <xueshuai at linux.alibaba.com>
Thanks.
Shuai
More information about the linux-arm-kernel
mailing list