public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Avoid failing shutdown tests without a journal
@ 2026-02-10 11:20 Jan Kara
  2026-02-10 11:20 ` [PATCH 1/4] ext4/051: Fix failure in nojournal mode Jan Kara
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Jan Kara @ 2026-02-10 11:20 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

Hello,

this patch series adds requirement for metadata journalling to couple
of tests using filesystem shutdown. After shutdown a filesystem without
a journal is not guaranteed to be consistent and thus tests often fail.

							Honza

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/4] ext4/051: Fix failure in nojournal mode
  2026-02-10 11:20 [PATCH 0/4] Avoid failing shutdown tests without a journal Jan Kara
@ 2026-02-10 11:20 ` Jan Kara
  2026-02-10 11:20 ` [PATCH 2/4] generic/635: Fix failure without a journal Jan Kara
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2026-02-10 11:20 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

The test uses fs shutdown. Without journalling the filesystem isn't
guaranteed to be consistent after shutdown so not much we can test
there.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 tests/ext4/051 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/ext4/051 b/tests/ext4/051
index 728ad19bfcec..9fbf0404fec9 100755
--- a/tests/ext4/051
+++ b/tests/ext4/051
@@ -16,6 +16,7 @@ _exclude_fs ext2
 _exclude_fs ext3
 _require_scratch
 _require_scratch_shutdown
+_require_metadata_journaling
 _require_command "$TUNE2FS_PROG" tune2fs
 
 echo "Silence is golden"
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/4] generic/635: Fix failure without a journal
  2026-02-10 11:20 [PATCH 0/4] Avoid failing shutdown tests without a journal Jan Kara
  2026-02-10 11:20 ` [PATCH 1/4] ext4/051: Fix failure in nojournal mode Jan Kara
@ 2026-02-10 11:20 ` Jan Kara
  2026-02-10 11:20 ` [PATCH 3/4] generic/646: " Jan Kara
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2026-02-10 11:20 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

The test uses fs shutdown. Without journalling the filesystem isn't
guaranteed to be consistent after shutdown so not much we can test
there.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 tests/generic/635 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/generic/635 b/tests/generic/635
index 4a811630a621..018b868cb6ce 100755
--- a/tests/generic/635
+++ b/tests/generic/635
@@ -26,6 +26,7 @@ _begin_fstest auto quick atime bigtime shutdown
 
 _require_scratch
 _require_scratch_shutdown
+_require_metadata_journaling
 
 _scratch_mkfs > $seqres.full
 _scratch_mount
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/4] generic/646: Fix failure without a journal
  2026-02-10 11:20 [PATCH 0/4] Avoid failing shutdown tests without a journal Jan Kara
  2026-02-10 11:20 ` [PATCH 1/4] ext4/051: Fix failure in nojournal mode Jan Kara
  2026-02-10 11:20 ` [PATCH 2/4] generic/635: Fix failure without a journal Jan Kara
@ 2026-02-10 11:20 ` Jan Kara
  2026-02-10 11:20 ` [PATCH 4/4] generic/705: " Jan Kara
  2026-02-12  8:40 ` [PATCH 0/4] Avoid failing shutdown tests " Zorro Lang
  4 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2026-02-10 11:20 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

The test uses fs shutdown. Without journalling the filesystem isn't
guaranteed to be consistent after shutdown so not much we can test
there.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 tests/generic/646 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/generic/646 b/tests/generic/646
index b3b0ab0ace56..1e3f0cd54087 100755
--- a/tests/generic/646
+++ b/tests/generic/646
@@ -19,6 +19,7 @@ _begin_fstest auto quick recoveryloop shutdown
 
 _require_scratch
 _require_scratch_shutdown
+_require_metadata_journaling
 _scratch_mkfs > $seqres.full 2>&1
 
 _scratch_mount
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/4] generic/705: Fix failure without a journal
  2026-02-10 11:20 [PATCH 0/4] Avoid failing shutdown tests without a journal Jan Kara
                   ` (2 preceding siblings ...)
  2026-02-10 11:20 ` [PATCH 3/4] generic/646: " Jan Kara
@ 2026-02-10 11:20 ` Jan Kara
  2026-02-12  8:40 ` [PATCH 0/4] Avoid failing shutdown tests " Zorro Lang
  4 siblings, 0 replies; 10+ messages in thread
From: Jan Kara @ 2026-02-10 11:20 UTC (permalink / raw)
  To: fstests; +Cc: linux-ext4, Jan Kara

The test uses fs shutdown. Without journalling the filesystem isn't
guaranteed to be consistent after shutdown so not much we can test
there.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 tests/generic/705 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/generic/705 b/tests/generic/705
index 9c27fbbc389b..23f06d699dfa 100755
--- a/tests/generic/705
+++ b/tests/generic/705
@@ -12,6 +12,7 @@ _begin_fstest auto shutdown
 
 _require_scratch
 _require_scratch_shutdown
+_require_metadata_journaling
 _require_command "$FILEFRAG_PROG" filefrag
 _scratch_mkfs > $seqres.full 2>&1
 _scratch_mount
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] Avoid failing shutdown tests without a journal
  2026-02-10 11:20 [PATCH 0/4] Avoid failing shutdown tests without a journal Jan Kara
                   ` (3 preceding siblings ...)
  2026-02-10 11:20 ` [PATCH 4/4] generic/705: " Jan Kara
@ 2026-02-12  8:40 ` Zorro Lang
  2026-02-12 10:41   ` Jan Kara
  4 siblings, 1 reply; 10+ messages in thread
From: Zorro Lang @ 2026-02-12  8:40 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests, linux-ext4, linux-xfs

On Tue, Feb 10, 2026 at 12:20:17PM +0100, Jan Kara wrote:
> Hello,
> 
> this patch series adds requirement for metadata journalling to couple
> of tests using filesystem shutdown. After shutdown a filesystem without
> a journal is not guaranteed to be consistent and thus tests often fail.

Hi Jan,

This patchset makes sense to me, thanks for fixing them :)

Since you brought this up, I just tried to check all cases using _require_scratch_shutdown
but lack _require_metadata_journaling, I got this:

$ for f in `grep -rsnl _require_scratch_shutdown tests/`;do grep -q _require_metadata_journaling $f || echo $f;done
tests/ext4/051       <=== fixed by this patchset
tests/generic/050
tests/generic/461
tests/generic/474
tests/generic/536
tests/generic/599
tests/generic/622
tests/generic/635    <=== fixed by this patchset
tests/generic/646    <=== fixed by this patchset
tests/generic/705    <=== fixed by this patchset
tests/generic/722
tests/generic/730
tests/generic/737
tests/generic/775
tests/generic/778
tests/overlay/078
tests/overlay/087
tests/xfs/270
tests/xfs/546

g/050 tests ro mount, so it might not need _require_metadata_journaling.
g/461 doesn't care the fs consistency, so ignore it too.
g/730 looks like doesn't need _require_metadata_journaling.
overlay/087 looks like can ignore _require_metadata_journaling.

Others, include g/474, g/536, g/599, g/622, g/722, g/737, g/775, g/778, overlay/078
look like all need a journal fs.

About x/270 and x/546, if we don't suppose other fs would like to run
xfs cases, then xfs always support journal.

I initially considered calling _require_metadata_journaling directly inside
_require_scratch_shutdown. However, I decided against it because some cases might
only need the shutdown ioctl and don't strictly require a journal.

Does these make sense to you?

Thanks,
Zorro

> 
> 							Honza
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] Avoid failing shutdown tests without a journal
  2026-02-12  8:40 ` [PATCH 0/4] Avoid failing shutdown tests " Zorro Lang
@ 2026-02-12 10:41   ` Jan Kara
  2026-02-12 16:44     ` Zorro Lang
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Kara @ 2026-02-12 10:41 UTC (permalink / raw)
  To: Zorro Lang; +Cc: Jan Kara, fstests, linux-ext4, linux-xfs

On Thu 12-02-26 16:40:50, Zorro Lang wrote:
> On Tue, Feb 10, 2026 at 12:20:17PM +0100, Jan Kara wrote:
> > Hello,
> > 
> > this patch series adds requirement for metadata journalling to couple
> > of tests using filesystem shutdown. After shutdown a filesystem without
> > a journal is not guaranteed to be consistent and thus tests often fail.
> 
> Hi Jan,
> 
> This patchset makes sense to me, thanks for fixing them :)
> 
> Since you brought this up, I just tried to check all cases using _require_scratch_shutdown
> but lack _require_metadata_journaling, I got this:
> 
> $ for f in `grep -rsnl _require_scratch_shutdown tests/`;do grep -q _require_metadata_journaling $f || echo $f;done
> tests/ext4/051       <=== fixed by this patchset
> tests/generic/050
> tests/generic/461
> tests/generic/474
> tests/generic/536
> tests/generic/599
> tests/generic/622
> tests/generic/635    <=== fixed by this patchset
> tests/generic/646    <=== fixed by this patchset
> tests/generic/705    <=== fixed by this patchset
> tests/generic/722
> tests/generic/730
> tests/generic/737
> tests/generic/775
> tests/generic/778
> tests/overlay/078
> tests/overlay/087
> tests/xfs/270
> tests/xfs/546
> 
> g/050 tests ro mount, so it might not need _require_metadata_journaling.

Yes, g/050 checks using _has_metadata_journaling and treats the fs
accordingly.

> g/461 doesn't care the fs consistency, so ignore it too.

Ack.

> g/730 looks like doesn't need _require_metadata_journaling.

Ack.

> overlay/087 looks like can ignore _require_metadata_journaling.

I think this actually needs it since we shutdown the fs and then mount it
again which may fail with inconsistent fs.

> Others, include g/474, g/536, g/599, g/622, g/722, g/737, g/775, g/778,
> overlay/078
> look like all need a journal fs.

g/474 seems good to test without metadata journalling it does syncfs and
then shutdown. In that case the data checksums should be valid even without
journalling.

g/599 should be also fine - we shutdown after remounting ro so that should
be working even without journalling.

g/622 - some bits should work even without journalling but for now I guess
we should just require it for simplicity.

g/737 - uses O_SYNC - should work even without journalling (perhaps the
test should be extended to fsync also the parent dir for complete correctness).

g/775 - tests atomic writes - should work even without journalling if the
fs claims to support atomic writes

g/778 - ditto

overlay/078 - this fsyncs the file before shutdown so it should work even
without journalling (but might need to fsync the parent dir for complete
correctness).

> About x/270 and x/546, if we don't suppose other fs would like to run
> xfs cases, then xfs always support journal.

Correct.

> I initially considered calling _require_metadata_journaling directly inside
> _require_scratch_shutdown. However, I decided against it because some cases might
> only need the shutdown ioctl and don't strictly require a journal.

Absolutely. I think they should stay separate.

So to summarize I think we should still add _require_metadata_journaling to:

overlay/087
g/536
g/622
g/722

and we might add fsync of parent directory before shutdown to g/737 and
overlay/078. Does this sound good?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] Avoid failing shutdown tests without a journal
  2026-02-12 10:41   ` Jan Kara
@ 2026-02-12 16:44     ` Zorro Lang
  2026-02-16  8:56       ` Jan Kara
  0 siblings, 1 reply; 10+ messages in thread
From: Zorro Lang @ 2026-02-12 16:44 UTC (permalink / raw)
  To: Jan Kara; +Cc: Zorro Lang, fstests, linux-ext4, linux-xfs

On Thu, Feb 12, 2026 at 11:41:59AM +0100, Jan Kara wrote:
> On Thu 12-02-26 16:40:50, Zorro Lang wrote:
> > On Tue, Feb 10, 2026 at 12:20:17PM +0100, Jan Kara wrote:
> > > Hello,
> > > 
> > > this patch series adds requirement for metadata journalling to couple
> > > of tests using filesystem shutdown. After shutdown a filesystem without
> > > a journal is not guaranteed to be consistent and thus tests often fail.
> > 
> > Hi Jan,
> > 
> > This patchset makes sense to me, thanks for fixing them :)
> > 
> > Since you brought this up, I just tried to check all cases using _require_scratch_shutdown
> > but lack _require_metadata_journaling, I got this:
> > 
> > $ for f in `grep -rsnl _require_scratch_shutdown tests/`;do grep -q _require_metadata_journaling $f || echo $f;done
> > tests/ext4/051       <=== fixed by this patchset
> > tests/generic/050
> > tests/generic/461
> > tests/generic/474
> > tests/generic/536
> > tests/generic/599
> > tests/generic/622
> > tests/generic/635    <=== fixed by this patchset
> > tests/generic/646    <=== fixed by this patchset
> > tests/generic/705    <=== fixed by this patchset
> > tests/generic/722
> > tests/generic/730
> > tests/generic/737
> > tests/generic/775
> > tests/generic/778
> > tests/overlay/078
> > tests/overlay/087
> > tests/xfs/270
> > tests/xfs/546
> > 
> > g/050 tests ro mount, so it might not need _require_metadata_journaling.
> 

Hi Jan,

Thanks for your detailed response.

> Yes, g/050 checks using _has_metadata_journaling and treats the fs
> accordingly.

I didn't notice that line, thanks.

> 
> > g/461 doesn't care the fs consistency, so ignore it too.
> 
> Ack.
> 
> > g/730 looks like doesn't need _require_metadata_journaling.
> 
> Ack.
> 
> > overlay/087 looks like can ignore _require_metadata_journaling.
> 
> I think this actually needs it since we shutdown the fs and then mount it
> again which may fail with inconsistent fs.

Thanks for the reminder, I totally overlooked the sync call. You're right, even
aside from the journal, sync effectively help filesystem to be a consistent
state (if no any hardware crashes during the sync running)

> 
> > Others, include g/474, g/536, g/599, g/622, g/722, g/737, g/775, g/778,
> > overlay/078
> > look like all need a journal fs.
> 
> g/474 seems good to test without metadata journalling it does syncfs and
> then shutdown. In that case the data checksums should be valid even without
> journalling.

Sure.

> 
> g/599 should be also fine - we shutdown after remounting ro so that should
> be working even without journalling.

Oh, there's "_scratch_remount ro" before shutdown, sure.

> 
> g/622 - some bits should work even without journalling but for now I guess
> we should just require it for simplicity.
> 
> g/737 - uses O_SYNC - should work even without journalling (perhaps the
> test should be extended to fsync also the parent dir for complete correctness).
> 
> g/775 - tests atomic writes - should work even without journalling if the
> fs claims to support atomic writes
> 
> g/778 - ditto
> 
> overlay/078 - this fsyncs the file before shutdown so it should work even
> without journalling (but might need to fsync the parent dir for complete
> correctness).

I'm not sure we can arbitrarily add more sync calls before or after a specific
fsync step. Doing so might break the original intent of the test. So I think
we can keep it, and see if anyone complains or hits a bug later :)

> 
> > About x/270 and x/546, if we don't suppose other fs would like to run
> > xfs cases, then xfs always support journal.
> 
> Correct.
> 
> > I initially considered calling _require_metadata_journaling directly inside
> > _require_scratch_shutdown. However, I decided against it because some cases might
> > only need the shutdown ioctl and don't strictly require a journal.
> 
> Absolutely. I think they should stay separate.
> 
> So to summarize I think we should still add _require_metadata_journaling to:
> 
> overlay/087
> g/536
> g/622
> g/722

Agree :)

> 
> and we might add fsync of parent directory before shutdown to g/737 and
> overlay/078. Does this sound good?

I'm concerned that adding broader sync or fsync operations might interfere with the
test's original intent. We should probably evaluate the impact further. Alternatively,
we could simply use _require_metadata_journaling to ensure we at least keep the
coverage for the original bug :)

Any more ideas please feel free to tell me.

Thanks,
Zorro

> 
> 								Honza
> -- 
> Jan Kara <jack@suse.com>
> SUSE Labs, CR
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] Avoid failing shutdown tests without a journal
  2026-02-12 16:44     ` Zorro Lang
@ 2026-02-16  8:56       ` Jan Kara
  2026-02-16 13:13         ` Zorro Lang
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Kara @ 2026-02-16  8:56 UTC (permalink / raw)
  To: Zorro Lang; +Cc: Jan Kara, Zorro Lang, fstests, linux-ext4, linux-xfs

On Fri 13-02-26 00:44:02, Zorro Lang wrote:
> On Thu, Feb 12, 2026 at 11:41:59AM +0100, Jan Kara wrote:
> > > I initially considered calling _require_metadata_journaling directly inside
> > > _require_scratch_shutdown. However, I decided against it because some cases might
> > > only need the shutdown ioctl and don't strictly require a journal.
> > 
> > Absolutely. I think they should stay separate.
> > 
> > So to summarize I think we should still add _require_metadata_journaling to:
> > 
> > overlay/087
> > g/536
> > g/622
> > g/722
> 
> Agree :)

Should I send patches or will you do this modification?

> > and we might add fsync of parent directory before shutdown to g/737 and
> > overlay/078. Does this sound good?
> 
> I'm concerned that adding broader sync or fsync operations might interfere with the
> test's original intent. We should probably evaluate the impact further. Alternatively,
> we could simply use _require_metadata_journaling to ensure we at least keep the
> coverage for the original bug :)

I agree with the approach to just leave the test as is for now and invest time
into deciding what's the proper solution once someone complains :)

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/4] Avoid failing shutdown tests without a journal
  2026-02-16  8:56       ` Jan Kara
@ 2026-02-16 13:13         ` Zorro Lang
  0 siblings, 0 replies; 10+ messages in thread
From: Zorro Lang @ 2026-02-16 13:13 UTC (permalink / raw)
  To: Jan Kara; +Cc: Zorro Lang, fstests, linux-ext4, linux-xfs

On Mon, Feb 16, 2026 at 09:56:07AM +0100, Jan Kara wrote:
> On Fri 13-02-26 00:44:02, Zorro Lang wrote:
> > On Thu, Feb 12, 2026 at 11:41:59AM +0100, Jan Kara wrote:
> > > > I initially considered calling _require_metadata_journaling directly inside
> > > > _require_scratch_shutdown. However, I decided against it because some cases might
> > > > only need the shutdown ioctl and don't strictly require a journal.
> > > 
> > > Absolutely. I think they should stay separate.
> > > 
> > > So to summarize I think we should still add _require_metadata_journaling to:
> > > 
> > > overlay/087
> > > g/536
> > > g/622
> > > g/722
> > 
> > Agree :)
> 
> Should I send patches or will you do this modification?

As you brought this issue up, so I'd like to leave the finish line to you :)
I saw your 4 patches nearly use same subject and commit log too. If you fix more 4 cases,
we'll have 8 seperated patches :-D So how about squashing all changes into one single
patch? Does that make sense to you?

Thanks,
Zorro

> 
> > > and we might add fsync of parent directory before shutdown to g/737 and
> > > overlay/078. Does this sound good?
> > 
> > I'm concerned that adding broader sync or fsync operations might interfere with the
> > test's original intent. We should probably evaluate the impact further. Alternatively,
> > we could simply use _require_metadata_journaling to ensure we at least keep the
> > coverage for the original bug :)
> 
> I agree with the approach to just leave the test as is for now and invest time
> into deciding what's the proper solution once someone complains :)
> 
> 								Honza
> -- 
> Jan Kara <jack@suse.com>
> SUSE Labs, CR
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-02-16 13:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 11:20 [PATCH 0/4] Avoid failing shutdown tests without a journal Jan Kara
2026-02-10 11:20 ` [PATCH 1/4] ext4/051: Fix failure in nojournal mode Jan Kara
2026-02-10 11:20 ` [PATCH 2/4] generic/635: Fix failure without a journal Jan Kara
2026-02-10 11:20 ` [PATCH 3/4] generic/646: " Jan Kara
2026-02-10 11:20 ` [PATCH 4/4] generic/705: " Jan Kara
2026-02-12  8:40 ` [PATCH 0/4] Avoid failing shutdown tests " Zorro Lang
2026-02-12 10:41   ` Jan Kara
2026-02-12 16:44     ` Zorro Lang
2026-02-16  8:56       ` Jan Kara
2026-02-16 13:13         ` Zorro Lang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox