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>
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>
Merge git://github.com/ceph/ceph