Re: [PATCH 02/11] persistent_ram: Fix buffer size clamping during writes

Dan Carpenter
2012-05-13T16:53:19Z

On Fri, May 11, 2012 at 05:17:17PM -0700, Anton Vorontsov wrote:
> This is a longstanding bug, almost unnoticeable when calling
> persistent_ram_write() for small buffers.
>
> But when called for large data buffers, the write routine behaves
> incorrectly, as the size may never update: instead of clamping
> the size to the maximum buffer size, buffer_size_add_clamp() returns
> an error (which is never checked by the write routine, btw).
>
> To fix this, we now use buffer_size_add() that actually clamps the
> size to the max value.
>
> Also remove buffer_size_add_clamp(), it is no longer needed.
>

Say if you did notice it, what would that look like? It's just that
something gets lost instead of written to the screen right?

regards,
dan carpenter