sheep: let add_vdi_state() be a thread safe

add_vdi_state() can be called by worker threads. So ec_max_data_strip
should be protected by a mutex.

Tested-by: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: compare oid directly

Comparing hash values of oids for purposes like sorting and searching
is completely unreasonable. This patch lets obj_cmp() compare oids
directly.

Tested-by: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
sheep: rollback vnode info which is younger than last gathered epoch for ec

sheep needs to rollback vnode info history beyond last gathered epoch
for erasure coding. Because erasure coded VDIs require recovery from
stale directory when a number of nodes is smaller than a number of
data stripes.

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

Reported-by: Valerio Pachera <sirio81@gmail.com>
Tested-by: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
tests/functional: a new test for erasure coding recovery

This new test case checks recovery process for a case of nr nodes < nr
data stripes.

Tested-by: Valerio Pachera <sirio81@gmail.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>