Skip to contentSkip to conversation

Add checks for hard links support.

PATCH In review Ari Sundholm 2 participants 3 messages Aug 28, 2015 – Aug 31, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 Add checks for hard links support.

From: Ari Sundholm <[email protected]>

There are filesystems that do not support hard links that we want to run xfstests on. Add a function for checking for support and use it wherever hard links are used.

v2: Move all checks for hard link support to this patch.

---
 common/rc         |   12 ++++++++++++
 tests/generic/002 |    1 +
 tests/generic/039 |    1 +
 tests/generic/040 |    1 +
 tests/generic/041 |    1 +
 tests/generic/056 |    1 +
 tests/generic/057 |    1 +
 tests/generic/065 |    1 +
 tests/generic/066 |    1 +
 tests/generic/084 |    1 +
 tests/generic/090 |    1 +
 tests/generic/104 |    1 +
 tests/generic/106 |    1 +
 tests/generic/236 |    1 +
 tests/generic/294 |    1 +
 15 files changed, 26 insertions(+)
common/rc +12 -0
index 780b7ed..d3aeddf 100644
@@ -2714,6 +2714,18 @@ _require_test_symlinks()
 	rm -f $target $link
 }
 
+_require_test_hardlinks()
+{
+	target=`mktemp -p $TEST_DIR`
+	link=`mktemp -p $TEST_DIR -u`
+	ln `basename $target` $link
+	if [ "$?" -ne 0 ]; then
+		rm -f $target
+		_notrun "Require hardlinks support"
+	fi
+	rm -f $target $link
+}
+
 _require_test_fcntl_advisory_locks()
 {
 	[ "$FSTYP" != "cifs" ] && return 0
tests/generic/002 +1 -0
index f63b208..0b96709 100755
@@ -43,6 +43,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _supported_os IRIX Linux
+_require_test_hardlinks
 _require_test
 
 echo "Silence is goodness ..."
tests/generic/039 +1 -0
index 4bbfc50..367a6d0 100755
@@ -55,6 +55,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/040 +1 -0
index c841fbc..1b8287f 100755
@@ -60,6 +60,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/041 +1 -0
index f38b662..588d5ff 100755
@@ -64,6 +64,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/056 +1 -0
index 8bb1522..e111bec 100755
@@ -53,6 +53,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/057 +1 -0
index 3b9f89e..d3b1aa2 100755
@@ -53,6 +53,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/065 +1 -0
index 739a4d5..5403c53 100755
@@ -54,6 +54,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/066 +1 -0
index cb36506..51aa22a 100755
@@ -58,6 +58,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_attrs
tests/generic/084 +1 -0
index 3fec6c2..86c38db 100755
@@ -46,6 +46,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
+_require_test_hardlinks
 _require_scratch
 
 link_unlink_storm()
tests/generic/090 +1 -0
index a1f2b89..c3eeb1a 100755
@@ -52,6 +52,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/104 +1 -0
index eeb7363..9fed5f2 100755
@@ -48,6 +48,7 @@ _cleanup()
 _need_to_be_root
 _supported_fs generic
 _supported_os Linux
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/106 +1 -0
index 0afee41..59efe7c 100755
@@ -47,6 +47,7 @@ _cleanup()
 _need_to_be_root
 _supported_fs generic
 _supported_os Linux
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV
tests/generic/236 +1 -0
index 12ea0bc..df0250f 100755
@@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 # only Linux supports fallocate
 _supported_os Linux
+_require_test_hardlinks
 _require_test
 
 rm -f $TEST_DIR/ouch*
tests/generic/294 +1 -0
index 3fa6ba2..944b6a1 100755
@@ -46,6 +46,7 @@ _cleanup()
 # Modify as appropriate.
 _supported_fs generic
 _supported_os Linux
+_require_test_hardlinks
 _require_scratch
 
 rm -f $seqres.full
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 5 lines · Ari Sundholm

From: Ari Sundholm <[email protected]>

There are filesystems that do not support hard links that we want to run xfstests on. Add a function for checking for support and use it wherever hard links are used.

As I've already pointed out, all of the filesystems that xfstests supports have working hardlinks, so this is a test that will never fail for anyone running xfstests on supported filesystems.

Also, I'm left to wonder what kernel filesystem supports journaling but does not support hardlinks (as noted by the number of tests you change that have "_require_metadata_journaling"). Why aren't you also posting the patches to support the filesystem that requires this "don't use hardlinks" patch?

And FWIW:

common/rc _require_test_symlinks() · line 2727

Quoted 11 lines
common/rc +11 -0
+_require_test_hardlinks()
+{
+	target=`mktemp -p $TEST_DIR`
+	link=`mktemp -p $TEST_DIR -u`
+	ln `basename $target` $link
+	if [ "$?" -ne 0 ]; then
+		rm -f $target
+		_notrun "Require hardlinks support"
+	fi
+	rm -f $target $link
+}

You check for support on the TEST_DEV, but ...

tests/generic/039 trap "_cleanup; exit \$status" 0 1 2 3 15 · line 61

Quoted 12 lines
tests/generic/039 +1 -0
index 4bbfc50..367a6d0 100755
@@ -55,6 +55,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _need_to_be_root
+_require_test_hardlinks
 _require_scratch
 _require_dm_flakey
 _require_metadata_journaling $SCRATCH_DEV

All but two of the tests you've added this check to make hard links on the SCRATCH_DEV, which can have a different configuration to the TEST_DEV.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#2 lore raw
Quoted 11 lines · Dave Chinner
Quoted 5 lines · Ari Sundholm

From: Ari Sundholm <[email protected]>

There are filesystems that do not support hard links that we want to run xfstests on. Add a function for checking for support and use it wherever hard links are used.

As I've already pointed out, all of the filesystems that xfstests supports have working hardlinks, so this is a test that will never fail for anyone running xfstests on supported filesystems.

Quoted 5 lines

Also, I'm left to wonder what kernel filesystem supports journaling but does not support hardlinks (as noted by the number of tests you change that have "_require_metadata_journaling"). Why aren't you also posting the patches to support the filesystem that requires this "don't use hardlinks" patch?

Just to clarify this: I don't care if people are using xfstests to test proprietary filesystem modules. I'm happy to add proper support for just about any filesystem, but that support needs to be *in full* so *anyone* can run the tests on that filesystem.

What I really don't like is people being evasive about the reason they want something changed. If there isn't a clear, full and convincing explanation of why a change should be made, then I will push back until such an explanation is given.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]