tests/func: remove --nosalt for openssl

Remove it fix a segfault on ubuntu-13.04. Though I don't know why.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests/func: fix Copies output due to format change

also update 081.out for a wrong update by commit 71c86fa

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: remove fd leak in vdi deletion process

The commit 5e460b4d6444 introduced fd leak in the vdi deletion
process. This patch removes it.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Merge branch 'stable-0.8' of github.com:sheepdog/sheepdog into stable-0.8
rpm: make dependencies of zookeeper and fuse packages optional

Current "make rpm" requires zookeeper-lib-devel and fuse-devel
unconditionally. When users don't want zookeeper driver or sheepfs,
they should be disabled.

Related issue:
https://bugs.launchpad.net/sheepdog-project/+bug/1264253

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
deb: create deb package from raw source archive

This patch makes it possible for users to create debian package from
raw source archive.

Related issue:
https://bugs.launchpad.net/sheepdog-project/+bug/1264255

Reported-by: Bastian Scholz <scholzb@t-online.de>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
lib: change xmalloc() to xvalloc() in sd_inode.c

The default_read_from_path() returned "Invalid argument" when we running
sheepdog cluster in test environment with sheep option "-D". The reason
is that the allocating memory for reading and writing btree-object is not
aligned. Therefore we should use xvalloc() instead of xmalloc() to allocate
aligned memory.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: go to panic if using unaligned memory in direct-io mode

When startup sheep with option "-D", the plain_store will check alignment of
read/write buffer, but if the buffer is not aligned, it will do nothing if
it dose not choose "--enable-debug" for configuration. Then sheep will open
file with "O_DIRECT" and call pread() with unaligned buffer, it will cause
error io and remove the disk from md which is totally wrong behavior.
So, we should make the check strong enough: sheep will panic directlly if
finding unaligned buffer.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: cleaning vdi deletion process, round 2

This patch cleans the vdi deletion process of sheep. Current vdi
deletion code creates one work for one deletion. It seems that there
is no reason to create so many work. This patch lets the code to
create only one work for vdi deletion request.

With this change, this patch improves simplicity of the code. For
example, the queue of struct deletion_info and related code are
removed.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: fix some compile errors

Both MIN/MAX and roundup are provided by glibc and would cause compile error
when we #include <sys/param.h>. Just use GNU version.

Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
add INFO level operation logging on each node.

Administrator couldn't track operation on each node without this function.
This function logs only administrative operation at rx_main and tx_main.
Operations that is not related to administrative operation are not
logged in this function. such as read/write etc.

Signed-off-by: Yoshinori Matsuo <matsuo.yoshinori@lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: save dw->finish_fd to local variable

We cannot access dw after we call delete_vdis_done() because it may be
already freed.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
ops: add NULL check of req->op

req->op can be NULL when the requested opcode is invalid.  It's safe
to add NULL checks before accessing req->op in ops.c.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: add helper function to make sure that req->data is string

There is no guarantee that req->data is a string.  Actually, the
current code can cause a buffer overrun when, e.g.,
SD_OP_FORCE_RECOVER is requested.

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

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
recovery: fix buffer overflow of rinfo->oids

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: initialize object cache info

This silences valgrind errors.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
fec: fix buffer overrun

After all the parities are set to out[], p will increase beyond
ctx->dp.  This adds a check for it.

This also adds assert() to make sure that we don't overrun the buffer.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: use correct error code in rebae_vdi()

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: fix vdi clone operation

- pass correct array size
- return FULL_VDI instead of wrong NO_BASE_VDI

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>