xfs: validate unicode filesystem labels

Make sure we can set and retrieve unicode labels, including emoji.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Darrick J. Wong
2019-05-20 15:31:21 -07:00
committed by Eryu Guan
parent 0eccec6cdb
commit cf2030a0c3
6 changed files with 176 additions and 30 deletions
+18
View File
@@ -4014,6 +4014,24 @@ _try_wipe_scratch_devs()
done
}
# Only run this on xfs if xfs_scrub is available and has the unicode checker
_check_xfs_scrub_does_unicode() {
[ "${FSTYP}" == "xfs" ] || return 1
local mount="$1"
local dev="$2"
_supports_xfs_scrub "${mount}" "${dev}" || return 1
# We only care if xfs_scrub has unicode string support...
if ! type ldd > /dev/null 2>&1 || \
! ldd "${XFS_SCRUB_PROG}" | grep -q libicui18n; then
return 1
fi
return 0
}
init_rc
################################################################################