Re: [PATCH bpf v2] lib/buildid: use __kernel_read() for sleepable context
From: Matthew Wilcox
Date: Mon Dec 22 2025 - 00:33:46 EST
On Fri, Dec 19, 2025 at 09:42:13AM -0800, Andrii Nakryiko wrote:
> From a user perspective, I'd very much appreciate it if I get exactly
> the requested amount of bytes from freader_fetch_sync(), so yeah,
> let's please keep the loop. It does seem that ret <= 0 handling is
> correct and should not result in an endless loop.
No, you don't understand. If __kernel_read() doesn't get all the data in
one call, it's not there to get. If a partial amount of data is useful
(I suspect not), we can return it, otherwise an error is the way to go.
The loop just betrays a lack of understanding of the VFS.