Re: [PATCH] mm,hwpoison: return -EBUSY when page already poisoned

From
Aili Yao <hidden>
Date
2021-03-02 08:12:55
Also in
linux-mm, lkml
Reply to
Luck, Tony, 2021-02-26
On Fri, 26 Feb 2021 09:58:37 -0800
"Luck, Tony" [off-list ref] wrote:
On Fri, Feb 26, 2021 at 10:52:50AM +0800, Aili Yao wrote:
quoted
Hi naoya,Oscar,david:  
quoted
  
quoted
We could use some negative value (error code) to report the reported case,
then as you mentioned above, some callers need change to handle the
new case, and the same is true if you use some positive value.
My preference is -EHWPOISON, but other options are fine if justified well.    
-EHWPOISON seems like a good fit.
  
I am OK with the -EHWPOISON error code, But I have one doubt here:
When we return this -EHWPOISON error code, Does this means we have to add a new error code
to error-base.h or errno.h? Is this easy realized?  
The page already poisoned isn't really an error though. Just the result
of a race condition.  What if we added an extra argument to memory_failure()
so it can tell the caller that the specific reason for the early successful
return is that the page was already poisoned?
It may be not an error, Is it reasonable to return a positive value like MF_HWPOISON, it seems the 0
return code donesn't tell the whole story. 

Your patch seems more safer, But I don't know if it's worth such multi module modifications for this case.
It really should be referenced to other maintainers and reviewers and thet can give more expert suggestions.

Thanks!
Aili Yao
Thread (2 messages) 2 messages, 2 authors, last reply 2021-03-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help