unit tests for pg_missing_t

All lines of code are tested. The conditions under which some methods
could corrupt the content of a pg_missing_t object have not been
investigated. Since the data members are public, the caller is
ultimately responsible for the consistency of the object and the
methods have no way to enforce it.

The semantics of is_missing have been discussed in
http://thread.gmane.org/gmane.comp.file-systems.ceph.devel/15280

Signed-off-by: Loic Dachary <loic@dachary.org>
merge_old_entry arguments info and oe are changed to const because
there is no side effect.

The PGLog::clear function is added to reset all data members to the
same state they have after the object is constructed.

Signed-off-by: Loic Dachary <loic@dachary.org>
os/LevelDBStore: fix merge loop

We were double-incrementing p, both in the for statement and in the
body.  While we are here, drop the unnecessary else's.

Signed-off-by: Sage Weil <sage@inktank.com>
vstart.sh: make client logs unique

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-fuse: create finisher threads after fork()

The ObjectCacher and MonClient classes both instantiate Finisher
threads.  We need to make sure they are created *after* the fork(2)
or else the process will fail to join() them on shutdown, and the
threads will not exist while fuse is doing useful work.

Put CephFuse on the heap and move all this initalization into the child
block, and make sure errors are passed back to the parent.

Fix-proposed-by: Alexandre Marangone <alexandre.maragone@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
ceph: Add missing usage "ceph osd blacklist ls"

Signed-off-by: David Zafman <david.zafman@inktank.com>
test_librbd: use correct type for varargs snap test

uint64_t is passed in, but int was extracted. This fails on 32-bit builds.

Fixes: #5220
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
mds: initialize some member variables of MDCache

I added some member variables to class MDCache, but forget to
initialize them.

Fixes: #5236
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
mds: allow purging "dirty parent" stray inode

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
unit tests for PGLog::merge_old_entry

The tests covers 100% of the LOC of merge_old_entry. It is broken down
in 13 cases to enumerate all the situations it must address. Each case
is isolated in a independant code block where the conditions are
reproduced. For  instance:

    info.last_backfill = hobject_t();
    info.last_backfill.hash = 1;
    oe.soid.hash = 2;

creates the conditions where merge_log_entry is expected to silently
ignore entries containing an object that is greater than
last_backfill.

PGLogTest is derived from PGLog to get access to the protected members.

Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #344 from ceph/wip-5220

Reviewed-by: Sage Weil <sage@inktank.com>
test_librbd: use correct type for varargs snap test

uint64_t is passed in, but int was extracted. This fails on 32-bit builds.

Fixes: #5220
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 17029b270dee386e12e5f42c2494a5feffd49b08)
test_filestore_idempotent: make newly created objects globally unique

The filestore requires hobjects to be globally unique.

Fixes: #5240
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
os/LevelDBStore: only remove logger if non-null

Signed-off-by: Sage Weil <sage@inktank.com>
Revert "mds: initialize some member variables of MDCache"

This reverts commit 2d655bde8de9ad255d63718768558399cacd7068.
mds: initialize rejoins_pending

Signed-off-by: Sage Weil <sage@inktank.com>
Revert "mds: allow purging "dirty parent" stray inode"

This reverts commit b8f1cb978944a616b69150fdbb3a6b978d75b1dc.
OSD: remove created argument from get_or_create_pg()

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD: make get_or_create_pg handle_pg_peering_evt

handle_pg_peering_evt() includes checking for splitting
and unlocking the pg.

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD: add pgid and res_map to DeletingState

Signed-off-by: Samuel Just <sam.just@inktank.com>