unit tests for FileStore::_detect_fs when running on ext4

unit tests are added in test/filestore/store_test.cc for the
FileStore::_detect_fs method, when using ext4. It tests the following
situations:

 * without user_xattr, ext4 fails
 * mounted with user_xattr, ext4 fails if filestore_xattr_use_omap is false
 * mounted with user_xattr, ext4 succeeds if filestore_xattr_use_omap is true

The tests are grouped in an ext4 dedicated class

  TEST(EXT4StoreTest, _detect_fs)

The qa/workunits/filestore/filestore.sh script is added to prepare the
environment required for the unit tests ( create an image file,
formats it with ext4 etc.). It runs ceph_test_filestore with a sudo
to allow it to mount(2) and umount(2) the ext4 file system. It is
called with

  ceph_test_filestore --gtest_filter=EXT4StoreTest.*

to only run the ext4 dependent tests.

The filestore.sh script is meant to be used as part of teuthology
in order to increase the code coverage for src/os/FileStore.cc. It is
self tested and can be checked from the source directory with

  CEPH_TEST_FILESTORE=../../../src/ceph_test_filestore filestore.sh TEST

http://tracker.ceph.com/issues/4321 refs #4321

Signed-off-by: Loic Dachary <loic@dachary.org>
ceph.spec: require xfsprogs

This is needed when creating new OSDs (via ceph-disk).  At least for most
people.  Eventually we'll want to include btrfs here.

Signed-off-by: Sage Weil <sage@inktank.com>
crush: return -1 on error from get_type_id

So we can distinguish between a bad type name and type 0.

Fix both callers, too.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: generate useful error msgs for 'osd crush rule create-simple ...'

Signed-off-by: Sage Weil <sage@inktank.com>
mon: avoid null deref in Monitor::_mon_status()

mikedawson reports:

*** Caught signal (Segmentation fault) **
 in thread 7f40ce270700

 ceph version 0.60-801-g7ec0151 (7ec01513970b5a977bdbdf60052b6f6e257d267e)
 1: /usr/bin/ceph-mon() [0x59d550]
 2: (()+0xfbd0) [0x7f40d3e38bd0]
 3: (operator<<(std::ostream&, entity_name_t const&)+0x16) [0x4d7c46]
 4: (operator<<(std::ostream&, entity_inst_t const&)+0x1b) [0x4d837b]
 5: (Monitor::_mon_status(std::ostream&)+0x2ce) [0x4d284e]
 6: (Monitor::do_admin_command(std::string, std::string, std::ostream&)+0x4f) [0x4d652f]
 7: (AdminHook::call(std::string, std::string, ceph::buffer::list&)+0x68) [0x4efa38]
 8: (AdminSocket::do_accept()+0x451) [0x64ab81]
 9: (AdminSocket::entry()+0x398) [0x64c528]
 10: (()+0x7f8e) [0x7f40d3e30f8e]
 11: (clone()+0x6d) [0x7f40d237ae1d]

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
ceph: add 'osd crush rule ...' to usage

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix init sequence when not daemonizing

We made the common_init_finish and chdir conditional on daemonize in commit
2e0dd5ae6c8751e33d456b2b06c1204b63db959a, breaking init (asok at least)
when -f is specified (as with upstart).

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
ceph.spec: add some files to ceph

Add installed, but not packaged files to ceph-test (ceph-monstore-tool,
ceph-osdomap-tool) rpm file section.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ceph.spec.in: remove twice listed ceph-coverage

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ceph-test.install: add ceph-monstore-tool and ceph-osdomap-tool

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ceph-disk: use separate lock files for prepare, activate

Use a separate lock file for prepare and activate to avoid deadlock.  This
didn't seem to trigger on all machines, but in many cases, the prepare
process would take the file lock and later trigger a udev event and the
activate would then block on the same lock, either when we explicitly call
'udevadm settle --timeout=10' or when partprobe does it on our behalf
(without a timeout!).   Avoid this by using separate locks for prepare
and activate.  We only care if multiple activates race; it is
okay for a prepare to be in progress and for an activate to be kicked
off.

Signed-off-by: Sage Weil <sage@inktank.com>
os/: default to dio for non-block journals

Workaround: #4910
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
v0.61
mon: allow leveldb logging

'mon leveldb log = filename'

Signed-off-by: Sage Weil <sage@inktank.com>
osd: optionally enable leveldb logging

Signed-off-by: Sage Weil <sage@inktank.com>
doc: Updated usage for push | pull.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Removed comment out of header, and added "coming soon."
doc: Corrected typo.
doc: Corrected typo.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Deleted redundant "so that" phrase.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>