Skip to content

printk_ringbuffer: Fix regression in get_data() and clean up data size checks

Petr Mladek linux-f2fs-devel linux-fsdevel linux-xfs lkml 1 version Applied

Status from this message: This series was applied to jaegeuk/f2fs.git (dev)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2printk_ringbuffer: Fix check of valid data size when blk_lpos overflowskernel/printk/printk_ringbuffer.c+6 -31 replyApplied
2/2printk_ringbuffer: Create a helper function to decide whether a more space is neededkernel/printk/printk_ringbuffer.c+27 -41 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJohn Ogness
1/2R-b T-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] printk_ringbuffer: Fix regression in get_data() and clean up data size checks

This is outcome of the long discussion about the regression caused
by 67e1b0052f6bb82 ("printk_ringbuffer: don't needlessly wrap data blocks around"), see https://lore.kernel.org/all/[email protected]/

The 1st patch fixes the regression as agreed, see
https://lore.kernel.org/all/[email protected]/

The 2nd patch adds a helper function to unify the checks whether a more space is needed. I did my best to address all the concerns about various proposed variants.

Note that I called the new helper function "need_more_space()" in the end. It avoids all the problems with "before" vs. "lt" vs "le",
and "_safe" vs. "_sane" vs. "_bounded".

IMHO, the name "need_more_space()" fits very well in all three locations, surprisingly even in data_realloc(). But it is possible that you disagree. Let me know if you hate it ;-)

The patchset applies on top of printk/linux.git, branch for-6.19. It should apply on top of linux-next as well.

Petr Mladek (2):
printk_ringbuffer: Fix check of valid data size when blk_lpos
overflows
printk_ringbuffer: Create a helper function to decide whether a more
space is needed

 kernel/printk/printk_ringbuffer.c | 40 +++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 7 deletions(-)
Signature · 1 line
2.51.1