Thread (12 messages) 12 messages, 5 authors, 2023-05-28

Re: [PATCH] [suggestion] mm/gup: avoid IS_ERR_OR_NULL

From: Lorenzo Stoakes <hidden>
Date: 2023-05-28 15:13:55
Also in: linux-mm, linux-perf-users, lkml

On Sat, May 27, 2023 at 06:52:01AM -0300, Jason Gunthorpe wrote:
On Sat, May 20, 2023 at 10:12:40AM +0100, Lorenzo Stoakes wrote:
quoted
quoted
No, this returning 0 on failure is a foot gun. Failing to pin a single
page is always an error, the only question is what sub reason caused
the error to happen. There is no third case where it is not an error.
The uprobe path thinks otherwise, but maybe the answer is that we just need
to -EFAULT on missing VMA and -EPERM on invalid flags.
I think uprobe is just broken to think there is a third outcome. Let's
just fix it instead of trying to pretend it makes sense.
Sure, will take a look at that if I get a chance. We can at the very least
adjust get_user_page_vma_remote() with this fixed.

Do you feel that a partially successful pinning for other GUP callers
should equally be treated as an error (and pages unpinned -> return error
code)? In that instance we'd need to audit things somewhat.

I have a couple more GUP cleanups saved up, so could add that to my queue
of things to look at between book work :)
Jason

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help