]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: let xfs_scrub tell us about its unicode checker
authorDarrick J. Wong <djwong@kernel.org>
Mon, 11 Apr 2022 22:55:02 +0000 (15:55 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 17 Apr 2022 14:19:16 +0000 (22:19 +0800)
Now that xfs_scrub can report whether or not it was built with the
Unicode name checker, rewrite _check_xfs_scrub_does_unicode to take
advantage of that.  This supersedes the old method of trying to observe
dynamic library linkages and grepping the binary, neither of which
worked very well.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index 83e932cf28bb2a948bb44fe03ed74a0f75c38dcd..553ae350f7937391fff48145fe72a6db61fe5d9d 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -4816,6 +4816,18 @@ _check_xfs_scrub_does_unicode() {
 
        _supports_xfs_scrub "${mount}" "${dev}" || return 1
 
+       # Newer versions of xfs_scrub advertise whether or not it supports
+       # Unicode name checks.
+       local xfs_scrub_ver="$("${XFS_SCRUB_PROG}" -VV)"
+
+       if echo "${xfs_scrub_ver}" | grep -q -- '-Unicode'; then
+               return 1
+       fi
+
+       if echo "${xfs_scrub_ver}" | grep -q -- '+Unicode'; then
+               return 0
+       fi
+
        # If the xfs_scrub binary contains the string "Unicode name.*%s", then
        # we know that it has the ability to complain about improper Unicode
        # names.