kselftest/arm64: mte: Report filename on failing temp file creation
authorAndre Przywara <andre.przywara@arm.com>
Fri, 19 Mar 2021 16:53:34 +0000 (16:53 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 24 Mar 2021 15:43:20 +0000 (15:43 +0000)
commit75347add03e0fa60ecf2f79e41ec2152b8504593
tree986b06915f8119b666e4397465e1092e38957377
parentb4e1fa2290691fda4392ac479115ee3b04a7534c
kselftest/arm64: mte: Report filename on failing temp file creation

The MTE selftests create temporary files in /dev/shm, for later mmap-ing
them. When there is no tmpfs mounted on /dev/shm, or /dev/shm does not
exist in the first place (on minimal filesystems), the error message is
not giving good hints:
    # FAIL: Unable to open temporary file
    # FAIL: memory allocation
    not ok 17 Check initial tags with private mapping, ...

Add a perror() call, that gives both the filename and the actual error
reason, so that users get a chance of correcting that.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Mark Brown <broone@kernel.org>
Link: https://lore.kernel.org/r/20210319165334.29213-12-andre.przywara@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/mte/mte_common_util.c