All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <li.wang@linux.dev>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH 2/3] swapon04: Add test for discard flags
Date: Fri, 28 Aug 2026 16:47:03 +0800	[thread overview]
Message-ID: <apFLB-NEelwmFXfW@linux.dev> (raw)
In-Reply-To: <6a91470b.7557dadb.15e29c.77e9@mx.google.com>

Hi Andrea,

> > I encountered an intermittent failure on my x86_64 platform running kernel 6.6.
> > This needs further investigation.
> > 
> > tst_test.c:1986: TINFO: === Testing on xfs ===
> > tst_test.c:1291: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''
> > tst_test.c:1303: TINFO: Mounting /dev/loop0 to /tmp/LTP_swa4Dz6aP/mntpoint fstyp=xfs flags=0
> > tst_device.c:103: TINFO: Found free device 1 '/dev/loop1'
> > swapon04.c:170: TPASS: blocks_after == blocks_before (32768)
> > swapon04.c:168: TPASS: blocks_after <= max_header_blocks (8 <= 16)
> > swapon04.c:168: TFAIL: blocks_after (32648) > max_header_blocks (16)
> > swapon04.c:170: TPASS: blocks_after == blocks_before (32768)
> > swapon04.c:168: TPASS: blocks_after <= max_header_blocks (8 <= 16)
> > swapon04.c:170: TPASS: blocks_after == blocks_before (32768)
> > swapon04.c:170: TPASS: blocks_after == blocks_before (32768)
> 

> this is interesting. Also I notice how it's hard to read the logs, so
> I need a TINFO before the checks. But technically, this could be a kernel
> bug: can you please add a sync() before stat() while we are getting the
> blocks_after? We might need to flush the cache before reading the blocks.
> 
> 	fd = SAFE_OPEN(BACKING_FILE, O_RDONLY);
> 	SAFE_FSYNC(fd);
> 	SAFE_CLOSE(fd);
> 

It doesn't work — even with the fsync() added above, the problem is
still reproducible. I agree it's likely a kernel bug, because I tried
on c10s (6.12) and c9s (5.14) and couldn't reproduce the issue there.

Only on kernel-v6.6-* fail:

# LTP_SINGLE_FS_TYPE=xfs ./swapon04 -i 100

swapon04.c:174: TPASS: blocks_after == blocks_before (32768)
swapon04.c:172: TPASS: blocks_after <= max_header_blocks (8 <= 16)
swapon04.c:174: TPASS: blocks_after == blocks_before (32768)
swapon04.c:174: TPASS: blocks_after == blocks_before (32768)
swapon04.c:174: TFAIL: blocks_after (32768) != blocks_before (65408)
swapon04.c:172: TFAIL: blocks_after (32648) > max_header_blocks (16)
...

swapon04.c:174: TPASS: blocks_after == blocks_before (32768)
swapon04.c:174: TPASS: blocks_after == blocks_before (32768)

Summary:
passed   670
failed   30
broken   0
skipped  0
warnings 0

-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-08-28  8:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 11:54 [LTP] [PATCH 0/3] Increase coverage for swapon syscall Andrea Cervesato
2026-08-27 11:54 ` [LTP] [PATCH 1/3] lapi: fallback definitions " Andrea Cervesato
2026-08-27 13:58   ` [LTP] " linuxtestproject.agent
2026-08-28  7:54   ` [LTP] [PATCH 1/3] " Li Wang
2026-08-27 11:54 ` [LTP] [PATCH 2/3] swapon04: Add test for discard flags Andrea Cervesato
2026-08-28  3:57   ` Li Wang
2026-08-28  8:30     ` Andrea Cervesato via ltp
2026-08-28  8:47       ` Li Wang [this message]
2026-08-28  9:02         ` Andrea Cervesato via ltp
2026-08-28  8:47       ` Andrea Cervesato via ltp
2026-08-28  9:01         ` Li Wang
2026-08-28  9:02           ` Andrea Cervesato via ltp
2026-08-28  9:12             ` Li Wang
2026-08-27 11:54 ` [LTP] [PATCH 3/3] swapon02: Add test cases for invalid swapflags Andrea Cervesato
2026-08-28  7:59   ` Li Wang

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=apFLB-NEelwmFXfW@linux.dev \
    --to=li.wang@linux.dev \
    --cc=andrea.cervesato@suse.com \
    --cc=ltp@lists.linux.it \
    /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.