Re: [PATCH 1/2] profile: account for partial /proc/profile reads

From: Andrew Morton

Date: Tue Oct 20 2026 - 20:51:42 EST


On Tue, 20 Oct 2026 17:47:06 -0700 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> read_profile() returns -EFAULT without advancing the file position
> when a user copy faults, even if earlier header bytes or a prefix of
> the counters were successfully copied. A retry can therefore copy
> the same bytes again despite the previous read having delivered data.
>
> Return the number of successfully copied bytes and advance *ppos by
> that amount. Return -EFAULT only if the fault occurs before any bytes
> are copied. Preserve the four-byte sampling-step header, raw counter
> representation, and normal successful-read behavior.
>
> Avi Weiss's "profiling: fix sampling step on 64-bit big-endian
> systems" is unchanged. This patch changes only short-read and
> fault reporting, not the output format.

Sashiko: "Failed To Apply".

bah. I'll resend all three.