All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Tso" <tytso@mit.edu>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-mm@kvack.org,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	linux-xfs@vger.kernel.org
Subject: [REGRESSION] generic/127 failure caused by "mm: Use folio_next_pos()"
Date: Mon, 24 Nov 2025 13:18:11 -0600	[thread overview]
Message-ID: <20251124191811.GA26781@mac.lan> (raw)

[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]

While testing the ext4 large blocksize patches I merged in
linux-next/fs-next to pick up the mm changes needed to prevent the
warnings when allocating larger blocks with GFP_NOFAIL, and I found
some unrelated regressions with three tests, including generic/127
(the other two regressions seem unrelated to this commit; I'll bisect
them separately).

Further testing found that regression occurred somewhere between
fs-current and fs-next, and I also found that it was failing not just
for ext4, but also for ext4.  A git bisect run localized the failure
to this commit:

commit 60a70e61430b2d568bc5e96f629c5855ee159ace
Author: Matthew Wilcox (Oracle) <willy@infradead.org>
Date:   Fri Oct 24 18:08:18 2025 +0100

    mm: Use folio_next_pos()
    
    This is one instruction more efficient than open-coding folio_pos() +
    folio_size().  It's the equivalent of (x + y) << z rather than
    x << z + y << z.
    
    Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    Link: https://patch.msgid.link/20251024170822.1427218-11-willy@infradead.org

I then checked out linux-next (aka linux-next/master) and verified
that the problem was reproducible there, using

kvm-xfstests -c ext4/4k generic/127 --fail-loop-count 0 --kernel-build

And then when I reverted commit 60a70e61430b, the test passed.  I also
checked and found that this commit was also causing generic/127 to
fail for xfs:

kvm-xfstests -c xfs/4k generic/127 --fail-loop-count 0 --kernel-build

And, with the commit reverted the problem went away.

The test logs for ext4 and xfs are attached.  Willy, could you take a
look?  Many thanks!!

							- Ted


[-- Attachment #2: ext4-generic-127.log --]
[-- Type: text/plain, Size: 4948 bytes --]

^[c^[[?7l^[[2J^[[0mSeaBIOS (version 1.17.0-debian-1.17.0-1)
Booting from ROM..^[c^[[?7l^[[2J^[[!p^[]104\a^[[?7h[^[[0;1;31mFAILED^[[0m] Failed to start ^[[0;1;39mnbd-server.service^[[0m - Network Block Device server.
CMDLINE: "-c ext4/4k generic/127 --fail-loop-count 0"
KERNEL: kernel	6.18.0-rc6-next-20251124-xfstests #20 SMP PREEMPT_DYNAMIC Mon Nov 24 14:04:48 EST 2025 x86_64
FSTESTVER: blktests	4badb27 (Fri, 31 Oct 2025 19:53:27 +0900)
FSTESTVER: fio		fio-3.41 (Fri, 5 Sep 2025 14:21:17 -0600)
FSTESTVER: fsverity	v1.7 (Tue, 4 Nov 2025 17:28:17 -0800)
FSTESTVER: ima-evm-utils	v1.5 (Mon, 6 Mar 2023 07:40:07 -0500)
FSTESTVER: libaio  	libaio-0.3.108-82-gb8eadc9 (Thu, 2 Jun 2022 13:33:11 +0200)
FSTESTVER: ltp		20250930 (Tue, 30 Sep 2025 13:53:45 +0200)
FSTESTVER: quota		v4.05-77-g22ff3d9 (Tue, 2 Sep 2025 08:12:02 -0400)
FSTESTVER: util-linux	v2.41.2 (Mon, 22 Sep 2025 12:56:34 +0200)
FSTESTVER: xfsprogs	v6.17.0 (Mon, 20 Oct 2025 16:49:00 +0200)
FSTESTVER: xfstests	v2025.11.04-12-g64e3dbda7 (Thu, 13 Nov 2025 19:58:03 -0500)
FSTESTVER: xfstests-bld	gce-xfstests-202504292206-33-g3844cb58 (Thu, 13 Nov 2025 21:05:49 -0500)
FSTESTVER: zz_build-distro	trixie
FSTESTCFG: "ext4/4k"
FSTESTSET: "generic/127"
FSTESTEXC: ""
FSTESTOPT: "fail_loop_count 0 aex"
MNTOPTS: ""
CPUS: "2"
MEM: "1969.56"
               total        used        free      shared  buff/cache   available
Mem:            1969         208        1749           0         143        1760
Swap:              0           0           0
BEGIN TEST 4k (1 test): Ext4 4k block Mon Nov 24 14:05:27 EST 2025
DEVICE: /dev/vdb
EXT_MKFS_OPTIONS: -b 4096
EXT_MOUNT_OPTIONS: -o block_validity
FSTYP         -- ext4
PLATFORM      -- Linux/x86_64 kvm-xfstests 6.18.0-rc6-next-20251124-xfstests #20 SMP PREEMPT_DYNAMIC Mon Nov 24 14:04:48 EST 2025
MKFS_OPTIONS  -- -F -q -b 4096 /dev/vdc
MOUNT_OPTIONS -- -o acl,user_xattr -o block_validity /dev/vdc /vdc

generic/127  31s ...  [14:05:28][    3.901891] run fstests generic/127 at 2025-11-24 14:05:28
[    4.092040] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (42) finished: extent logical block 25, len 15; IO logical block 25, len 8
[    4.101284] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (47) finished: extent logical block 25, len 15; IO logical block 25, len 8
[    4.125984] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (47) finished: extent logical block 35, len 9; IO logical block 39, len 1
[    4.129140] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (47) finished: extent logical block 35, len 4; IO logical block 36, len 3
[    4.181406] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (42) finished: extent logical block 3, len 14; IO logical block 8, len 9
[    4.194278] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (42) finished: extent logical block 31, len 11; IO logical block 31, len 10
[    4.198459] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (47) finished: extent logical block 3, len 14; IO logical block 8, len 9
[    4.207676] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (50) finished: extent logical block 25, len 15; IO logical block 25, len 8
[    4.217111] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (47) finished: extent logical block 31, len 11; IO logical block 31, len 10
[    4.221635] EXT4-fs warning (device vdb): ext4_convert_unwritten_extents_endio:3774: Inode (41) finished: extent logical block 25, len 15; IO logical block 25, len 8
 [14:05:39]- output mismatch (see /results/ext4/results-4k/generic/127.out.bad)
    --- tests/generic/127.out	2025-11-13 21:05:49.000000000 -0500
    +++ /results/ext4/results-4k/generic/127.out.bad	2025-11-24 14:05:39.225714867 -0500
    @@ -1,7 +1,34117 @@
     QA output created by 127
    +/root/xfstests/ltp/fsx -q -l 262144 -o 65536 -S 191110531 -N 100000 -R -W fsx_std_nommap
    +READ BAD DATA: offset = 0x11303, size = 0xf7b0, fname = /vdb/fsx_std_nommap
    +OFFSET      GOOD    BAD     RANGE
    +0x14000     0x0000  0xfc9f  0x0
    +operation# (mod 256) for the bad data may be 252
    +0x14001     0x0000  0x9ffc  0x1
    ...
    (Run 'diff -u /root/xfstests/tests/generic/127.out /results/ext4/results-4k/generic/127.out.bad'  to see the entire diff)
Ran: generic/127
Failures: generic/127
Failed 1 of 1 tests
Xunit report: /results/ext4/results-4k/result.xml

               total        used        free      shared  buff/cache   available
Mem:            1969         206        1822           0          28        1762
Swap:              0           0           0
END TEST: Ext4 4k block Mon Nov 24 14:05:39 EST 2025

[-- Attachment #3: xfs-generic-127.log --]
[-- Type: text/plain, Size: 7436 bytes --]

^[c^[[?7l^[[2J^[[0mSeaBIOS (version 1.17.0-debian-1.17.0-1)
Booting from ROM..^[c^[[?7l^[[2J^[[!p^[]104\a^[[?7h[^[[0;1;31mFAILED^[[0m] Failed to start ^[[0;1;39mnbd-server.service^[[0m - Network Block Device server.
CMDLINE: "-c xfs/4k generic/127 --fail-loop-count 0"
KERNEL: kernel	6.18.0-rc6-next-20251124-xfstests #20 SMP PREEMPT_DYNAMIC Mon Nov 24 14:04:48 EST 2025 x86_64
FSTESTVER: blktests	4badb27 (Fri, 31 Oct 2025 19:53:27 +0900)
FSTESTVER: fio		fio-3.41 (Fri, 5 Sep 2025 14:21:17 -0600)
FSTESTVER: fsverity	v1.7 (Tue, 4 Nov 2025 17:28:17 -0800)
FSTESTVER: ima-evm-utils	v1.5 (Mon, 6 Mar 2023 07:40:07 -0500)
FSTESTVER: libaio  	libaio-0.3.108-82-gb8eadc9 (Thu, 2 Jun 2022 13:33:11 +0200)
FSTESTVER: ltp		20250930 (Tue, 30 Sep 2025 13:53:45 +0200)
FSTESTVER: quota		v4.05-77-g22ff3d9 (Tue, 2 Sep 2025 08:12:02 -0400)
FSTESTVER: util-linux	v2.41.2 (Mon, 22 Sep 2025 12:56:34 +0200)
FSTESTVER: xfsprogs	v6.17.0 (Mon, 20 Oct 2025 16:49:00 +0200)
FSTESTVER: xfstests	v2025.11.04-12-g64e3dbda7 (Thu, 13 Nov 2025 19:58:03 -0500)
FSTESTVER: xfstests-bld	gce-xfstests-202504292206-33-g3844cb58 (Thu, 13 Nov 2025 21:05:49 -0500)
FSTESTVER: zz_build-distro	trixie
FSTESTCFG: "xfs/4k"
FSTESTSET: "generic/127"
FSTESTEXC: ""
FSTESTOPT: "fail_loop_count 0 aex"
MNTOPTS: ""
CPUS: "2"
MEM: "1969.56"
               total        used        free      shared  buff/cache   available
Mem:            1969         212        1745           0         143        1756
Swap:              0           0           0
meta-data=/dev/vdd               isize=512    agcount=4, agsize=327680 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=1
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=1
         =                       exchange=0   metadir=0
data     =                       bsize=4096   blocks=1310720, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=0
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
         =                       rgcount=0    rgsize=0 extents
         =                       zoned=0      start=0 reserved=0
Discarding blocks...Done.
BEGIN TEST 4k (1 test): XFS 4k block Mon Nov 24 14:06:31 EST 2025
DEVICE: /dev/vdd
XFS_MKFS_OPTIONS: -bsize=4096
XFS_MOUNT_OPTIONS: 
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 kvm-xfstests 6.18.0-rc6-next-20251124-xfstests #20 SMP PREEMPT_DYNAMIC Mon Nov 24 14:04:48 EST 2025
MKFS_OPTIONS  -- -f -bsize=4096 /dev/vdc
MOUNT_OPTIONS -- /dev/vdc /vdc

generic/127  31s ...  [14:06:33][    6.886269] run fstests generic/127 at 2025-11-24 14:06:33
[    7.333668] vdd: writeback error on inode 137, offset 208896, sector 2622528
[    7.338078] XFS (vdd): Corruption of in-memory data (0x8) detected at xfs_trans_mod_sb+0x2b6/0x370 (fs/xfs/xfs_trans.c:353).  Shutting down filesystem.
[    7.341384] XFS (vdd): Please unmount the filesystem and rectify the problem(s)
[    7.342570] XFS: Assertion failed: tp->t_blk_res >= tp->t_blk_res_used, file: fs/xfs/xfs_trans.c, line: 120
[    7.344123] ------------[ cut here ]------------
[    7.344851] WARNING: fs/xfs/xfs_message.c:104 at assfail+0x33/0x3a, CPU#1: kworker/1:0/23
[    7.346172] CPU: 1 UID: 0 PID: 23 Comm: kworker/1:0 Not tainted 6.18.0-rc6-next-20251124-xfstests #20 PREEMPT(none) 
[    7.347861] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.17.0-debian-1.17.0-1 04/01/2014
[    7.349936] Workqueue: xfs-conv/vdd xfs_end_io
[    7.350759] RIP: 0010:assfail+0x33/0x3a
[    7.351341] Code: 49 89 d0 41 89 c9 48 c7 c2 d8 18 a8 82 48 89 f1 48 89 fe 48 c7 c7 e4 0c b0 82 e8 b8 fd ff ff 80 3d 59 6d ba 01 00 74 02 0f 0b <0f> 0b e9 41 da ed ff 48 8d 45 10 48 89 e2 48 89 de 4c 89 34 24 48
[    7.354327] RSP: 0018:ffa00000000cbc00 EFLAGS: 00010246
[    7.355161] RAX: 0000000000000000 RBX: ff11000011dafbc8 RCX: 000000007fffffff
[    7.356328] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff82b00ce4
[    7.357522] RBP: ff11000011dafd98 R08: 0000000000000000 R09: 000000000000000a
[    7.358681] R10: 000000000000000a R11: 0fffffffffffffff R12: 000000050002f3f8
[    7.359835] R13: 0000000000039a46 R14: ff11000011dafe68 R15: ff11000011dafe68
[    7.361031] FS:  0000000000000000(0000) GS:ff110000fa430000(0000) knlGS:0000000000000000
[    7.362325] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    7.363273] CR2: 00007fbb37aaa350 CR3: 0000000002c2e003 CR4: 0000000000771ef0
[    7.364422] PKRU: 55555554
[    7.364872] Call Trace:
[    7.365309]  <TASK>
[    7.365671]  xfs_trans_dup+0x16e/0x1c0
[    7.366287]  xfs_trans_roll+0x2e/0xd0
[    7.366906]  xfs_defer_trans_roll+0x53/0x130
[    7.367608]  ? srso_alias_return_thunk+0x5/0xfbef5
[    7.368393]  xfs_defer_finish_noroll+0x2cd/0x500
[    7.369419]  xfs_trans_commit+0x4c/0x70
[    7.370486]  ? xfs_iomap_write_unwritten+0x180/0x320
[    7.371227]  xfs_iomap_write_unwritten+0xce/0x320
[    7.371932]  xfs_end_ioend+0x207/0x2b0
[    7.372517]  xfs_end_io+0xb5/0x100
[    7.373046]  process_one_work+0x18c/0x360
[    7.373697]  worker_thread+0x268/0x3b0
[    7.374265]  ? __pfx_worker_thread+0x10/0x10
[    7.374910]  kthread+0x10a/0x230
[    7.375422]  ? __pfx_kthread+0x10/0x10
[    7.375989]  ? __pfx_kthread+0x10/0x10
[    7.376577]  ret_from_fork+0x95/0x110
[    7.377142]  ? __pfx_kthread+0x10/0x10
[    7.377709]  ret_from_fork_asm+0x1a/0x30
[    7.378303]  </TASK>
[    7.378663] ---[ end trace 0000000000000000 ]---
[    7.379365] vdd: writeback error on inode 132, offset 184320, sector 888
_check_xfs_filesystem: filesystem on /dev/vdd has dirty log
(see /results/xfs/results-4k/generic/127.full for details)
_check_xfs_filesystem: filesystem on /dev/vdd is inconsistent (r)
(see /results/xfs/results-4k/generic/127.full for details)
Trying to repair broken TEST_DEV file system
_check_dmesg: something found in dmesg (see /results/xfs/results-4k/generic/127.dmesg)
 [14:06:34]- output mismatch (see /results/xfs/results-4k/generic/127.out.bad)
    --- tests/generic/127.out	2025-11-13 21:05:49.000000000 -0500
    +++ /results/xfs/results-4k/generic/127.out.bad	2025-11-24 14:06:34.037856472 -0500
    @@ -1,7 +1,25950 @@
     QA output created by 127
    -All 100000 operations completed A-OK!
    -All 100000 operations completed A-OK!
    -All 100000 operations completed A-OK!
    -All 100000 operations completed A-OK!
    -All 100000 operations completed A-OK!
    -All 100000 operations completed A-OK!
    ...
    (Run 'diff -u /root/xfstests/tests/generic/127.out /results/xfs/results-4k/generic/127.out.bad'  to see the entire diff)
Ran: generic/127
Failures: generic/127
Failed 1 of 1 tests
Xunit report: /results/xfs/results-4k/result.xml

               total        used        free      shared  buff/cache   available
Mem:            1969         309        1719           0          30        1660
Swap:              0           0           0
END TEST: XFS 4k block Mon Nov 24 14:06:34 EST 2025

             reply	other threads:[~2025-11-24 19:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 19:18 Theodore Tso [this message]
2025-11-24 19:20 ` [REGRESSION] generic/127 failure caused by "mm: Use folio_next_pos()" Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251124191811.GA26781@mac.lan \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.