tests/functional: fixed wrong error message

v2:
- fixed indention error

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: disable glibc's dynamic mmap threshold

This solves the problem that freed memory is retained in the long running sheep.

This is due to glibc's memory allocation implementation (ptmalloc). For
allocations greater than or equal to the limit specified by M_MMAP_THRESHOLD
that can't be satisfied from the free list, the memory-allocation functions
employ mmap(2) instead of increasing the program break using sbrk(2).

So for the long running sheep,
1 M_MMAP_THRESHOLD is increased to the extent that all the allocation use its
  internal cached chunks on the heap.
2 ptmalloc can't release the memory of sub-heap back if top chunk is in use.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
md: prefix md functions with md_ for better 'grep'

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
plain store: consolidate err_to_sderr

We should not raise EIO handling of md layer as hard as we can. EEXIST is not a
fatal problem for most cases and even though upper layer should handle it
themselves, we can treat it as a trivial error as a safe guard here.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: check local request if it is in recovery

This fixes a panic of a corner case that when object is pushed to backend store
and this object is in recovery, we'll get NO_OBJ error and pusher get paniced.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: use 1M log space for non-debug mode startup

This will save a lot of memory footprint of sheep daemon

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: fix default_link on EEXIST of link

This is observed by the following bug:

Jun 18 21:55:11 [rw] default_link(377) failed to link from
/mnt/ST2000DM001-1CH164_W1E2N5GM/obj/.stale/0002e519000054f1.21 to
/mnt/ST2000DM001-1CH164_W1E2N5GM/obj/0002e519000054f1, File exists
Jun 18 21:55:11 [rw] err_to_sderr(96) oid=2e519000054f1, File exists
Jun 18 21:55:11 [main] remove_disk(319) /mnt/ST2000DM001-1CH164_W1E2N5GM/obj from multi-disk array

Reported-by: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
util: consolidate atomic_create_and_write to be concurrency friendly

Only one thread can call this function on the specified path.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
functional: add 065 to test cache push

This can reproduce the bug fixed by
"sheep: check local request if it is in recovery"

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
functional: add 066 to stress test object cache

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: make _wait_for_sheep run faster

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: tmp

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>