librbd: fix crash using clone of flattened image

The crash occurs due to ImageCtx->parent->parent being uninitialized,
since the inital open_parent() -> open_image(parent) ->
ictx_refresh(parent) occurs before ImageCtx->parent->snap_id is set,
so refresh_parent() is not called to open an ImageCtx for the parent
of the parent. This leaves the ImageCtx->parent->parent NULL, but the
rest of ImageCtx->parent updated to point at the correct parent snapshot.

Setting the parent->snap_id earlier has some unintended side effects
currently, so for now just call refresh_parent() during
open_parent(). This is the easily backportable version of the
fix. Further patches can clean up this whole initialization process.

Fixes: #8845
Backport: firefly, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librbd: store and retrieve snapshot metadata based on id

Snapshots are usually accessed by id internally, so change accessors
to take id instead of name. Keep a separate map of name -> id for
looking up human-specified names.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
mailmap: Red Hat names normalization

Signed-off-by: Loic Dachary <loic@dachary.org>
librbd: enable rbd cache by default; writethrough until flush

This is recommended and safe.  Avoid some user confusion.

Signed-off-by: Sage Weil <sage@redhat.com>
mailmap: Ma Jianpeng affiliation

and name normalization

Reviewed-by: Ma Jianpeng <jianpeng.ma@intel.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Kevin Cox affiliation

Reviewed-by: Kevin Cox <kevincox@kevincox.ca>
Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Accela Zhao affiliation

Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Adam Crume affiliation

Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Stephen Jahl affiliation

Reviewed-by: Stephen Jahl <stephenjahl@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: George Ryall affiliation

Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Brian Rak affiliation

and name normalization

Reviewed-by: Brian Rak <dn@devicenull.org>
Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Sebastien Ponce name normalization

Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: João Eduardo Luís name normalization

Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Tommi Virtanen is not with Red Hat

The entry was added by s/inktank/redhat/ and did not acknowledge that
Tommi Virtanen left Inktank before it was acquired.

Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: sort entries

to help avoid duplicates (found one)

Signed-off-by: Loic Dachary <loic@dachary.org>
add annotation for rocksdb config option

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
enable info_log_level config option for rocksdb

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
test/ceph-disk.sh: mkdir -p

Signed-off-by: Sage Weil <sage@redhat.com>
test/osd/osd-test-helpers: mkdir -p for ceph-disk

Signed-off-by: Sage Weil <sage@redhat.com>
erasure-code: ErasureCode base class

Add the ErasureCode base class for ErasureCodeJerasure and
ErasureCodeIsa, for methods that can be shared among all plugins.

http://tracker.ceph.com/issues/8496 Fixes: #8496

Signed-off-by: Loic Dachary <loic@dachary.org>