Skip to contentSkip to conversation

xfs/073: avoid large recurise diff

PATCH In review Christoph Hellwig 3 participants 4 messages Jun 20, 2024 – Jun 21, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs/073: avoid large recurise diff

xfs/073 has been failing for me for a while on most of my test setups with:

diff: memory exhausted

from the large recursive diff it does. Replace that with a pipe using md5sum to reduce the memory usage.

Based on a snipplet from Darrick Wong.

---
 tests/xfs/073 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/xfs/073 +2 -1
index c7616b9e9..0f96fdb09 100755
@@ -76,7 +76,8 @@ _verify_copy()
 	fi
 
 	echo comparing new image files to old
-	diff -Naur $source_dir $target_dir
+	(cd $source_dir; find . -type f -print0 | xargs -0 md5sum) | \
+	(cd $target_dir ; md5sum -c --quiet)
 
 	echo comparing new image directories to old
 	find $source_dir | _filter_path $source_dir > $tmp.manifest1
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Christoph Hellwig

xfs/073 has been failing for me for a while on most of my test setups with:

diff: memory exhausted

from the large recursive diff it does. Replace that with a pipe using md5sum to reduce the memory usage.

Based on a snipplet from Darrick Wong.

LGTM

Quoted 9 lines
---
 tests/xfs/073 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/xfs/073 +0 -0
index c7616b9e9..0f96fdb09 100755

tests/xfs/073 _verify_copy() · line 80

Quoted 6 lines
tests/xfs/073 +2 -1
@@ -76,7 +76,8 @@ _verify_copy()
 	fi
 
 	echo comparing new image files to old
-	diff -Naur $source_dir $target_dir
+	(cd $source_dir; find . -type f -print0 | xargs -0 md5sum) | \
+	(cd $target_dir ; md5sum -c --quiet)

Dumb nit: shellcheck ^^ tells me these semicolons should be a '&&' so
that the find/md5sum won't run if the cd fails, but the incorrect file list and whatever error messages cd coughs up will be enough to fail the test anyway.

--D

Quoted 7 lines
tests/xfs/073 +0 -0
 	echo comparing new image directories to old
 	find $source_dir | _filter_path $source_dir > $tmp.manifest1
Signature · 1 line
2.43.0
#2 lore raw

Looking at the reply I noticed I misspelled recursive in the subject, so maybe this can get fixed up when applying the patch?

#3 lore raw
Quoted 2 lines · Christoph Hellwig

Looking at the reply I noticed I misspelled recursive in the subject, so maybe this can get fixed up when applying the patch?

Sure, I've noticed that and have changed it in my local branch :)

Thanks,
Zorro

Quoted 2 lines