Skip to contentSkip to conversation

README: remove incorrect check -udf usage

PATCH In review David Disseldorp 2 participants 5 messages Jun 26, 2017 – Jun 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 README: remove incorrect check -udf usage

The -udf parameter for check does not exist. UDF can still be tested via the configuration parameter FSTYP=udf.

---
 README | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
README +1 -3
index fd491e4a..11bf6a94 100644
@@ -120,12 +120,10 @@ Running tests:
     - Groups of tests maybe ran by: ./check -g [group(s)]
       See the 'group' file for details on groups
     - To randomize test order: ./check -r [test(s)]
-    - You can explicitly specify NFS/CIFS/UDF/OVERLAY, otherwise
+    - You can explicitly specify NFS/CIFS/OVERLAY, otherwise
       the filesystem type will be autodetected from $TEST_DEV:
         - for running nfs tests: ./check -nfs [test(s)]
         - for running cifs/smb3 tests: ./check -cifs [test(s)]
-        - for udf tests: ./check -udf [test(s)]
-          Running all the udf tests: ./check -udf -g udf
         - for overlay tests: ./check -overlay [test(s)]
           The TEST and SCRATCH partitions should be pre-formatted
           with another base fs, where the overlay dirs will be created
Signature · 1 line
2.12.3
#1 lore raw

PATCH 2/2 common: remove tmp.mkfs[err/std] files by name

Without any $tmp suffix, users silly enough to run xfstests without mktemp present will unintentionally "rm -f *".

---
 common/rc  | 2 +-
 common/xfs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/rc +1 -1
index ff1b75c9..a38f4e03 100644
@@ -595,7 +595,7 @@ _scratch_do_mkfs()
 	cat $tmp.mkfsstd
 	eval "cat $tmp.mkfserr | $mkfs_filter" >&2
 
-	rm -f $tmp*
+	rm -f $tmp.mkfsstd $tmp.mkfserr
 	return $mkfs_status
 }
 
common/xfs +1 -1
index 0f0825bc..59776a6f 100644
@@ -104,7 +104,7 @@ _scratch_mkfs_xfs()
 	# output mkfs stdout and stderr
 	cat $tmp.mkfsstd
 	cat $tmp.mkfserr >&2
-	rm -f $tmp*
+	rm -f $tmp.mkfsstd $tmp.mkfserr
 
 	return $mkfs_status
 }
Signature · 1 line
2.12.3
#2 lore raw

Re: [PATCH 2/2] common: remove tmp.mkfs[err/std] files by name

Quoted 4 lines · David Disseldorp

Without any $tmp suffix, users silly enough to run xfstests without mktemp present will unintentionally "rm -f *".

I posted a patch back in Jan. to cleanup tmp files and other leftover files after test, I switched from mktemp to a normal "tmp=/tmp/$$._mkfs" assignment so it could avoid this problem you want to fix too. But my patch got no review.

I'm going to send new version of my patch and will fix _scratch_do_mkfs too, I really appreciate if you could help review and provide Reviewed-by tag.

Thanks,
Eryu

Quoted 38 lines
---
 common/rc  | 2 +-
 common/xfs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/rc +1 -1
index ff1b75c9..a38f4e03 100644
@@ -595,7 +595,7 @@ _scratch_do_mkfs()
 	cat $tmp.mkfsstd
 	eval "cat $tmp.mkfserr | $mkfs_filter" >&2
 
-	rm -f $tmp*
+	rm -f $tmp.mkfsstd $tmp.mkfserr
 	return $mkfs_status
 }
 
common/xfs +1 -1
index 0f0825bc..59776a6f 100644
@@ -104,7 +104,7 @@ _scratch_mkfs_xfs()
 	# output mkfs stdout and stderr
 	cat $tmp.mkfsstd
 	cat $tmp.mkfserr >&2
-	rm -f $tmp*
+	rm -f $tmp.mkfsstd $tmp.mkfserr
 
 	return $mkfs_status
 }
Signature · 6 lines
2.12.3

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

Re: [PATCH 2/2] common: remove tmp.mkfs[err/std] files by name

Quoted 8 lines · Eryu Guan

I posted a patch back in Jan. to cleanup tmp files and other leftover files after test, I switched from mktemp to a normal "tmp=/tmp/$$._mkfs" assignment so it could avoid this problem you want to fix too. But my patch got no review.

I'm going to send new version of my patch and will fix _scratch_do_mkfs too, I really appreciate if you could help review and provide Reviewed-by tag.

Thanks for the feedback, Eryu. My preference would be to continue to use mktemp. I know it's test code, but I'd still like to avoid any potential symlink races.

Cheers, David

#4 lore raw

Re: [PATCH 2/2] common: remove tmp.mkfs[err/std] files by name

Quoted 11 lines · David Disseldorp
Quoted 8 lines · Eryu Guan

I posted a patch back in Jan. to cleanup tmp files and other leftover files after test, I switched from mktemp to a normal "tmp=/tmp/$$._mkfs" assignment so it could avoid this problem you want to fix too. But my patch got no review.

I'm going to send new version of my patch and will fix _scratch_do_mkfs too, I really appreciate if you could help review and provide Reviewed-by tag.

Quoted 5 lines

Thanks for the feedback, Eryu. My preference would be to continue to use mktemp. I know it's test code, but I'd still like to avoid any potential symlink races.

Cheers, David

mktemp doesn't really help in this case. What we do in _scratch_do_mkfs is like:

	local tmp=`mktemp`
	....
	eval "$mkfs_cmd ..." > $tmp.mkfsstd

$tmp is not used directly as a tmp file, it just serves as a common prefix, $tmp._any_suffix_ can be a symlink too. (BTW, remove only $tmp.mkfsstd and $tmp.mkfserr leaves $tmp itself in /tmp).

And I don't think it's that necessary to avoid potential symlink races in fstests, the "tmp=/tmp/$$ then write to $tmp.file" usage is almost everywhere in fstests. I agree it'd be great to avoid symlink races, but IMHO it's not worth the effort to make whole fstests symlink-race-free.

Thanks,
Eryu