kv_flat_btree_async.cc: release AioCompletion before leave the loop

CID 727982 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "aioc" going out of scope leaks the storage
  it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw: protect ops log socket formatter

Fixes: #4905
Ops log (through the unix domain socket) uses a formatter, which wasn't
protected.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
mon: implement --extract-monmap <filename>

This will make for a simpler process for
  http://ceph.com/docs/master/rados/operations/add-or-rm-mons/#removing-monitors-from-an-unhealthy-cluster

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit c0268e27497a4d8228ef54da9d4ca12f3ac1f1bf)
mds/MDCache.cc: fix possible NULL pointer dereference

Assert if 'cur' is NULL.

CID 966616 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "cur" when
  calling "CInode::is_dir()".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/MDS.cc: fix dereference null return value

Fix for:

returned_null: Function "SessionMap::get_session(entity_name_t)" returns
  null (checked 12 out of 14 times)

CID 739601 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null
  "this->sessionmap.get_session(entity_name_t::CLIENT(client.v))" when
  calling "MDS::send_message_client_counted(Message *, Session *)"

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rbd.cc: silence CID COPY_PASTE_ERROR warning

CID 1021212 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
  copy_paste_error: "r" in "r = -*__errno_location()" looks like
  a copy-paste error. Should it say "fd" instead?

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Server.cc: fix possible NULL pointer dereference

Add asserts to solve these CID issues:

CID 717002 (#1 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dir"
  when calling "CDir::lookup(std::string const &, snapid_t)".
CID 717002 (#2 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dir"
  when calling "CDir::lookup(std::string const &, snapid_t)".

CID 717003 (#1 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dn" when
  calling "operator <<(std::ostream &, CDentry &)"
CID 717003 (#2 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "straydn"
  when calling "CDentry::push_projected_linkage()".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Migrator.cc: fix possible NULL pointer dereference

Move dout() calls behind the related asserts to prevent possible NULL
pointer dereference.

CID 717001 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "diri" when calling
  "operator <<(std::ostream &, CInode

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Migrator.cc: fix dereference NULL return value

CID 717000 (#1 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dir" when
  calling "operator <<(std::ostream &, CDir &)".

CID 717000 (#2 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dir" when
  calling "Migrator::import_reverse_unfreeze(CDir *)".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge pull request #309 from dalgaaf/wip-da-CID-fixes-3-v2

Reviewed-by: Sage Weil <sage@inktank.com>
mds/Migrator.cc: fix possible dereference NULL return value

CID 716999 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "in" when
  calling "CInode::put_stickydirs()".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Migrator.cc: delete some empty lines at EOF

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Migrator.cc: fix possible dereference NULL return value

ID 716998 (#1 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "in" when
  calling "operator <<(std::ostream &, CInode &)".

CID 716998 (#2 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "in" when
  calling "MDCache::add_replica_dir(ceph::buffer::list::iterator &,
  CInode *, int, std::list<Context *, std::allocator<Context *> > &)".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Migrator.cc: fix possible dereference NULL return value

CID 716997 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "in" when
  calling "MDSCacheObject::is_auth() const".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge pull request #310 from dalgaaf/wip-da-CID-fixes-4

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #297 from dalgaaf/wip-da-CID-727982

Reviewed-by: Sage Weil <sage@inktank.com>
ceph: remove cli test

This is about to be removed by wip-ceph-cli anyway.  And it broke in
commit 132d5bf7f9af7de9e2028e20c95ba91637da5875.

Signed-off-by: Sage Weil <sage@inktank.com>
common: add mask argument to pick_addresses() to specify what we need

Fixes: #4228

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph-mon: only care about public addr during pick_addresses()

Fixes: #4228

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph-osd: specify which types of addresses to pick

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>