]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/801: provide missing sysfs-dump function
authorDarrick J. Wong <djwong@kernel.org>
Tue, 8 Apr 2025 18:17:32 +0000 (11:17 -0700)
committerZorro Lang <zlang@kernel.org>
Thu, 10 Apr 2025 14:32:59 +0000 (22:32 +0800)
This test uses sysfs-dump to capture THP diagnostic information to
$seqres.full.  Unfortunately, that's not a standard program (it's one of
my many tools) and I forgot to paste the script into the test.  Hence
it's been broken since merge for everyone else.  Fix it.

Cc: fstests@vger.kernel.org # v2024.08.11
Fixes: 518896a7b483c0 ("xfs: test online repair when xfiles consists of THPs")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/801

index 1190cfab8a9f949186290bea72b3f307066db486..a05a6efc1a90581092ad95ae77c782bdc94400c6 100755 (executable)
@@ -42,6 +42,18 @@ test -w "$knob" || _notrun "tmpfs transparent hugepages disabled"
 pagesize=`getconf PAGE_SIZE`
 pagesize_kb=$((pagesize / 1024))
 
+sysfs-dump() {
+       for i in "$@"; do
+               if [ -d "$i" ]; then
+                       for x in "$i/"*; do
+                               test -f "$x" && echo "$x: $(cat "$x")"
+                       done
+               else
+                       test -f "$i" && echo "$i: $(cat "$i")"
+               fi
+       done
+}
+
 echo "settings now: pagesize=${pagesize_kb}KB" >> $seqres.full
 sysfs-dump /sys/kernel/mm/transparent_hugepage/* >> $seqres.full