client: fix invalid iterator dereference in Client::trim_caps()

trimming inode drops a reference to the inode's parent, it may cause
the inode's parent also be trimmed. If the cap iterator 'p' happens to
point to the inode's parent and the inode's parent is trimmed, the cap
iterator 'p' become invalid.

Fix the issue by delaying removing cap from the seesion cap list.
(similar to what the kclient does)

Fixes #6599
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
common/cmdparse: fix memory leak

demangle is allocating with malloc() in this case.

Signed-off-by: Sage Weil <sage@inktank.com>
common/BackTrace: fix memory leak

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #751 from ceph/wip-6603

a couple trivial leaks
librbd: wire up flush counter

Fixes: #5668
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #753 from ceph/wip-5668-b

librbd: wire up flush counter
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
ceph-mon: add debug to ip selection

This will hopefully help us track down #5804.

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: fix build error

From a10703008f7f4eb57a62658f2b9a015eb81509d0.

Signed-off-by: Sage Weil <sage@inktank.com>
librbd: parse args to ceph_test_librbd

Signed-off-by: Sage Weil <sage@inktank.com>
  test_ceph_argparse.py: No assert_not_in and assert_in in nose.tools
  Signed-off-by: huangjun  <hjwsm1989@gmail.com>
ceph_test_librbd: fix heap overrun

We are storing rbd_snap_info_t structs, not pointers to them.  But we
can also avoid the heap entirely.

This crashed pretty reliably on arm.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #754 from ceph/wip-test-librbd

fix ceph_test_lirbd crash
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #749 from ceph/wip-6599

client: fix invalid iterator dereference in Client::trim_caps()

Backport: emperor, dumpling, cuttlefish
Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #756 from hjwsm1989/master

  test_ceph_argparse.py: No assert_not_in and assert_in in nose.tools

Reviewed-by: Loic Dachary <loic@dachary.org>
Merge remote-tracking branch 'gh/next'
common/shared_cache.hpp: avoid list::size()

Signed-off-by: Samuel Just <sam.just@inktank.com>
common/shared_cache.hpp: compact to a single lookup where possible

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