linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] check: Fix fs specfic imports when $FSTYPE!=$OLD_FSTYPE
@ 2025-01-12 15:21 Nirjhar Roy (IBM)
  2025-01-12 19:41 ` Ritesh Harjani
  2025-01-13  5:59 ` Zorro Lang
  0 siblings, 2 replies; 11+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-01-12 15:21 UTC (permalink / raw)
  To: fstests
  Cc: linux-ext4, linux-xfs, ritesh.list, ojaswin, djwong, zlang,
	nirjhar.roy.lists

Bug Description:

_test_mount function is failing with the following error:
./common/rc: line 4716: _xfs_prepare_for_eio_shutdown: command not found
check: failed to mount /dev/loop0 on /mnt1/test

when the second section in local.config file is xfs and the first section
is non-xfs.

It can be easily reproduced with the following local.config file

[s2]
export FSTYP=ext4
export TEST_DEV=/dev/loop0
export TEST_DIR=/mnt1/test
export SCRATCH_DEV=/dev/loop1
export SCRATCH_MNT=/mnt1/scratch

[s1]
export FSTYP=xfs
export TEST_DEV=/dev/loop0
export TEST_DIR=/mnt1/test
export SCRATCH_DEV=/dev/loop1
export SCRATCH_MNT=/mnt1/scratch

./check selftest/001

Root cause:
When _test_mount() is executed for the second section, the FSTYPE has
already changed but the new fs specific common/$FSTYP has not yet
been done. Hence _xfs_prepare_for_eio_shutdown() is not found and
the test run fails.

Fix:
call _source_specific_fs $FSTYP at the correct call site of  _test_mount()

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
 check | 1 +
 1 file changed, 1 insertion(+)

diff --git a/check b/check
index 607d2456..8cdbb68f 100755
--- a/check
+++ b/check
@@ -776,6 +776,7 @@ function run_section()
 	if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then
 		echo "RECREATING    -- $FSTYP on $TEST_DEV"
 		_test_unmount 2> /dev/null
+		[[ "$OLD_FSTYP" != "$FSTYP" ]] && _source_specific_fs $FSTYP
 		if ! _test_mkfs >$tmp.err 2>&1
 		then
 			echo "our local _test_mkfs routine ..."
-- 
2.34.1


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

end of thread, other threads:[~2025-01-15  5:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-12 15:21 [PATCH] check: Fix fs specfic imports when $FSTYPE!=$OLD_FSTYPE Nirjhar Roy (IBM)
2025-01-12 19:41 ` Ritesh Harjani
2025-01-13  5:59   ` Nirjhar Roy (IBM)
2025-01-13 15:39     ` Ritesh Harjani
2025-01-15  5:06       ` Nirjhar Roy (IBM)
2025-01-13  5:59 ` Zorro Lang
2025-01-13  8:52   ` Nirjhar Roy (IBM)
2025-01-13 13:11     ` Zorro Lang
2025-01-13 15:33       ` Ritesh Harjani
2025-01-15  5:10         ` Nirjhar Roy (IBM)
2025-01-15  5:07       ` Nirjhar Roy (IBM)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).