Re: [PATCH v8 05/15] guest_memfd: Use folio_has_hwpoisoned_page()

[email protected]
Newsgroups org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>

On 7/31/2026 1:07 PM, Matthew Wilcox (Oracle) wrote:
> folio_test_hwpoison() only works on hugetlb folios today and will give 
> the wrong answer for other large folios. folio_has_hwpoisoned_page() 
> works on both. Signed-off-by: Matthew Wilcox (Oracle) <willy@  
> infradead. org> Acked-by: Sean Christopherson
> 
> 
> folio_test_hwpoison() only works on hugetlb folios today and will give
> the wrong answer for other large folios.  folio_has_hwpoisoned_page()
> works on both.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
> Acked-by: Sean Christopherson <[email protected]>
> Reviewed-by: Ackerley Tng <[email protected]>
> Reviewed-by: Gregory Price <[email protected]>
> ---
>   virt/kvm/guest_memfd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
> index db57c5766ab6..94eedcc7f1a9 100644
> --- a/virt/kvm/guest_memfd.c
> +++ b/virt/kvm/guest_memfd.c
> @@ -774,7 +774,7 @@ static struct folio *__kvm_gmem_get_pfn(struct file *file,
>   	if (IS_ERR(folio))
>   		return folio;
>   
> -	if (folio_test_hwpoison(folio)) {
> +	if (folio_has_hwpoisoned_page(folio)) {
>   		folio_unlock(folio);
>   		folio_put(folio);
>   		return ERR_PTR(-EHWPOISON);
> -- 
> 2.47.3
> 

Reviewed-by: Jane Chu <[email protected]>

thanks,
-jane
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.