Re: [linus:master] [xfs] 304a68b9c6: WARNING:at_fs/iomap/buffered-io.c:#iomap_write_delalloc_release

From: Yujie Liu
Date: Fri Mar 03 2023 - 01:16:34 EST


On Fri, Mar 03, 2023 at 09:21:22AM +1100, Dave Chinner wrote:
> On Thu, Mar 02, 2023 at 04:39:03PM +0800, Yujie Liu wrote:
> > On Wed, Mar 01, 2023 at 09:11:07AM +1100, Dave Chinner wrote:
> > > On Tue, Feb 28, 2023 at 04:40:01PM +0800, kernel test robot wrote:
> > > > Greeting,
> > > >
> > > > FYI, we noticed WARNING:at_fs/iomap/buffered-io.c:#iomap_write_delalloc_release due to commit (built with gcc-11):
> > > >
> > > > commit: 304a68b9c63bbfc1f6e159d68e8892fc54a06067 ("xfs: use iomap_valid method to detect stale cached iomaps")
> > > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
> > > >
> > > > [test failed on linux-next/master 058f4df42121baadbb8a980c06011e912784dbd2]
> > > > in testcase: xfstests
> > > > version: xfstests-i386-5a5e419-1_20220926
> > > > with following parameters:
> > > >
> > > > disk: 4HDD
> > > > fs: xfs
> > > > test: generic-group-32
> > >
> > > Which fstest was running at the time this warning was thrown?
> >
> > It is fstests generic/648 running at that time.
>
> Ok.
>
> Can you add this patch and see if it fixes the problem?
>
> https://lore.kernel.org/linux-xfs/20230301221227.GH360264@xxxxxxxxxxxxxxxxxxx/

We applied this patch on commit 304a68b9c63b and tested it, but cannot
fix the problem.

=========================================================================================
compiler/disk/fs/kconfig/rootfs/tbox_group/test/testcase:
gcc-11/4HDD/xfs/i386-debian-10.3-func/debian-11.1-i386-20220923.cgz/lkp-skl-d01/generic-group-32/xfstests

commit:
d7b64041164c ("iomap: write iomap validity checks")
304a68b9c63b ("xfs: use iomap_valid method to detect stale cached iomaps")
e5a7d5f824ad ("xfs: fix off-by-one-block in xfs_discard_folio()")

d7b64041164ca177 304a68b9c63bbfc1f6e159d68e8 e5a7d5f824ad7409f85e2665d11
---------------- --------------------------- ---------------------------
fail:runs %reproduction fail:runs %reproduction fail:runs
| | | | |
:6 50% 3:3 100% 3:3 dmesg.EIP:iomap_write_delalloc_release
:6 50% 3:3 100% 3:3 dmesg.WARNING:at_fs/iomap/buffered-io.c:#iomap_write_delalloc_release

> > [ 78.565703][ T59] ------------[ cut here ]------------
> > [ 78.570983][ T59] WARNING: CPU: 4 PID: 59 at fs/iomap/buffered-io.c:984 iomap_write_delalloc_release (fs/iomap/buffered-io.c:984 (discriminator 1))
>
> Ok, that is:
>
> WARN_ON_ONCE(start_byte < punch_start_byte);
>
> Which I can't immediately see how that happens. This is a 32-bit
> i386 kernel which we largely don't test or support, so maybe there's
> 32/64 bit variable size change problem somewhere in the code path
> being executed.
>
> > [ 78.671542][ T59] Hardware name: Dell Inc. OptiPlex 7040/0Y7WYT, BIOS 1.2.8 01/26/2016
> > [ 78.679578][ T59] Workqueue: loop0 loop_rootcg_workfn [ loop]
>
> Ok, so this is happening while writing to the loopback image file
> which is racing with cloning and removing the clone of the image
> file.
>
> Looking at the rest of the trace, IO to the entire loopback file
> hung, but this warning doesn't explain that happening either.
>
> I'll try to reproduce it, but I don't actually have an i386 test
> environment here (I haven't tested i386 at all the last 5-6
> years!) so it might be a while before I can get to testing this
> specific environment.
>
> Do you see it reproduce on any other architecture, of just this one?

It can be reproduced on i386, but not on x86_64. Sorry that we don't
have machines of other architectures in the robot infrastructure.

=========================================================================================
commit/compiler/disk/fs/kconfig/rootfs/tbox_group/test/testcase:
304a68b9c63bbfc1f6e159d68e8892fc54a06067/gcc-11/4HDD/xfs/x86_64-rhel-8.3-func/debian-11.1-x86_64-20220510.cgz/lkp-skl-d01/generic-group-32/xfstests

commit/compiler/disk/fs/kconfig/rootfs/tbox_group/test/testcase:
304a68b9c63bbfc1f6e159d68e8892fc54a06067/gcc-11/4HDD/xfs/i386-debian-10.3-func/debian-11.1-i386-20220923.cgz/lkp-skl-d01/generic-group-32/xfstests

kconfig:
x86_64-rhel-8.3-func
i386-debian-10.3-func

x86_64-rhel-8.3-func i386-debian-10.3-func
---------------- ---------------------------
fail:runs %reproduction fail:runs
| | |
:3 100% 3:3 dmesg.EIP:iomap_write_delalloc_release
:3 100% 3:3 dmesg.WARNING:at_fs/iomap/buffered-io.c:#iomap_write_delalloc_release

--
Best Regards,
Yujie