David Howells wrote:
> > When 'head' and 'tail' wrap around, 'log->head - log->tail' will be
> > something like '4 - 252 = -248', and comparing that directly to the
> > array size is wrong. Fix by casting to 'u8'.
>
> I think a better fix is to use CIRC_CNT() or CIRC_SPACE().
Or it would be -
Eric Biggers wrote:
> When 'head' and 'tail' wrap around, 'log->head - log->tail' will be
> something like '4 - 252 = -248', and comparing that directly to the
> array size is wrong. Fix by casting to 'u8'.
I think a better fix is to use CIRC_CNT() or CIRC_SPACE().
David
From: Eric Biggers
When 'head' and 'tail' wrap around, 'log->head - log->tail' will be
something like '4 - 252 = -248', and comparing that directly to the
array size is wrong. Fix by casting to 'u8'.
Fixes: 09aeca629fb3 ("vfs: Implement logging through fs_context")
Signed-off-by: Eric Biggers
3 matches
Mail list logo