fsstress: Fix wrong size argument to getcwd()
authorRostislav Skudnov <rostislav@tuxera.com>
Thu, 5 Oct 2017 12:49:57 +0000 (12:49 +0000)
committerEryu Guan <eguan@redhat.com>
Fri, 6 Oct 2017 12:45:04 +0000 (20:45 +0800)
commitebd721deac57f55b9405c9ffdc9d23bad8b030ad
treedf9813e4980104e8f47d340d79de3a195fa3fb49
parent0e8adbc0bf2825c19ee261e8382adba66cd779a9
fsstress: Fix wrong size argument to getcwd()

Fixes the following ASAN failure:

==11670==WARNING: AddressSanitizer failed to allocate 0xffffffffffffffff bytes
==11670==AddressSanitizer's allocator is terminating the process instead of returning 0

...

    #5 0x4bb230 in __interceptor_malloc /home/vak-local/3.9.1/release/final/llvm.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:65:10
    #6 0x7f97e6491405 in getcwd /build/glibc-6V9RKT/glibc-2.19/io/../sysdeps/unix/sysv/linux/getcwd.c:68
    #7 0x454691 in getcwd /home/vak-local/3.9.1/release/final/llvm.src/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:2822:15
    #8 0x4f765d in doproc /.../ltp/fsstress.c:933:12
    #9 0x4f5f54 in main /.../ltp/fsstress.c:581:5

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ltp/fsstress.c