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>
_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.