Re: [f2fs-dev] [PATCH 0/2] printk_ringbuffer: Fix regression in get_data() and clean up data size checks

2025-11-10 Thread Petr Mladek via Linux-f2fs-devel
On Fri 2025-11-07 20:47:18, Petr Mladek wrote: > 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 pa

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

2025-11-07 Thread Petr Mladek via Linux-f2fs-devel
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

[f2fs-dev] [PATCH 2/2] printk_ringbuffer: Create a helper function to decide whether a more space is needed

2025-11-07 Thread Petr Mladek via Linux-f2fs-devel
The decision whether some more space is needed is tricky in the printk ring buffer code: 1. The given lpos values might overflow. A subtraction must be used instead of a simple "lower than" check. 2. Another CPU might reuse the space in the mean time. It can be detected when the sub

[f2fs-dev] [PATCH 1/2] printk_ringbuffer: Fix check of valid data size when blk_lpos overflows

2025-11-07 Thread Petr Mladek via Linux-f2fs-devel
The commit 67e1b0052f6bb8 ("printk_ringbuffer: don't needlessly wrap data blocks around") allows to use the last 4 bytes of the ring buffer. But the check for the @data_size was not properly updated in get_data(). It fails when "blk_lpos->next" overflows to "0". In this case: + is_blk_wrapped(d

Re: [f2fs-dev] [syzbot] [iomap?] kernel BUG in folio_end_read (2)

2025-11-07 Thread Petr Mladek via Linux-f2fs-devel
On Thu 2025-11-06 20:04:03, John Ogness wrote: > On 2025-11-06, Petr Mladek wrote: > >> diff --git a/kernel/printk/printk_ringbuffer.c > >> b/kernel/printk/printk_ringbuffer.c > >> index 839f504db6d30..8499ee642c31d 100644 > >> --- a/kernel/printk/printk_ringbuffer.c > >> +++ b/kernel/printk/prin

Re: [f2fs-dev] [syzbot] [iomap?] kernel BUG in folio_end_read (2)

2025-11-06 Thread Petr Mladek via Linux-f2fs-devel
On Thu 2025-11-06 12:42:21, John Ogness wrote: > On 2025-11-05, John Ogness wrote: > >> Another question is whether this is the only problem caused the patch. > > > > This comparison is quite special. It caught my attention while combing > > through the code. > > The reason that this comparison i

Re: [f2fs-dev] [syzbot] [iomap?] kernel BUG in folio_end_read (2)

2025-11-05 Thread Petr Mladek via Linux-f2fs-devel
On Wed 2025-11-05 16:00:28, John Ogness wrote: > On 2025-11-04, Petr Mladek wrote: > > Adding John into Cc. > > Thanks. > > > It rather looks like an internal bug in the printk_ringbuffer code. > > And there is only one recent patch: > > > >https://patch.msgid.link/20250905144152.9137-2-d-ta

Re: [f2fs-dev] [syzbot] [iomap?] kernel BUG in folio_end_read (2)

2025-11-04 Thread Petr Mladek via Linux-f2fs-devel
Adding John into Cc. On Tue 2025-11-04 09:45:27, Joanne Koong wrote: > On Mon, Nov 3, 2025 at 6:43 PM syzbot > wrote: > > > > Hello, > > > > syzbot has tested the proposed patch but the reproducer is still triggering > > an issue: > > WARNING in get_data > > > > loop0: detected capacity change f