md: create .stale for newly plugged disk

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
md: fix a fatal bug in check_and_move()

We can't rename(2) objects accross devices and this will cause recovery to fail.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
md: make MD support as always enabled

Currently, we can plug new disks even MD isn't enabled. Following process

$ sheep /store # MD isn't enabled
$ collie node md plug /new_disk

will cause big trouble because plugging will succeed and force a recovery where
old /store isn't counted in the disk arrays.

To avoid such random careless opertaion and keep simplicity, this patch:

Make MD support as always enabled then the interface to be more upgradeing friendly:

   $ sheep /store # will enable MD and meta-store and object-store will share the same /store
   $ sheep /metastore,/disk1{,.../diskN,...} # works as before

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
md: trim last slashes from paths

Currently, same path with different trailing slashes will be treated as
different paths such as following example

$ collie node md plug /store
$ collie node md plug /store/

Both will plug succeed (so as to unplug). This is obviously wrong.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: don't allow empty path for 'node md' command

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: init journal file after init_disk_space()

When MD is enabled, we have to call journal_file_init() after
init_disk_space().  Otherwise, sheep cannot replay journal entries
correctly since md_disks are setup in md_init_space().

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

The correct format strings are:
 - %zd for ssize_t
 - %zu for size_t
 - %PRIu64 for uint64_t

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
tests: don't use $@ in double quotations

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