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>
mds: update backtrace when old format inode is touched

We updated inode format version to 7 when introducing inode backtrace.
If we found a inode's format version < 7 when fetching the inode, set
the inode's backtrace_version to 0, to indicate the inode's backtrace
is out of data. When touching a inode with backtrace_version == 0, we
also update its backtrace.

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>
rgw: turn swift COPY into PUT

Fixes: #6606
The swift COPY operation is unique in a sense that it's a write
operation that has its destination not set by the URI target, but by a
different HTTP header. This is problematic as there are some hidden
assumptions in the code that the specified bucket/object in the URI is
the operation target. E.g., certain initialization functions, quota,
etc. Instead of creating a specialized code everywhere for this case
just turn it into a regular copy operation, that is, a PUT with
a specified copy source.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: get rid of req_state.bucket_name

No need for this field, as we already have req_state.bucket_name_str.
This saves us some memory allocation / freeing through every request
processing.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: init src_bucket_name, src_object in the S3 handler

Be consistent and initialize these fields also in the S3 case.

Signed-off-by: Yehuda Sadeh <yehuda@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'
rgw: don't bother to call c_str() on strings passed to dump_string()

dump_string() also accepts const string reference.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>