mgr/DaemonServer.cc: add 'is_valid=false' when decode caps error
Reviewed-by: Jos Collin <jcollin@redhat.com>
Reviewed-by: John Spray <john.spray@redhat.com>
We were decrementing size and then breaking out ENOENT condition check.
Fix by decrementing size only after we break out of the loop and verify
we found the item.
Fix a follow-on bug by avoiding realloc when we have 0 items left. This case
was never exercised before due to the ENOENT issue; now we return explicitly.
It's really not necessary to realloc at all, probably, since these are very
small arrays, but in any case leaving a single item allocation there in place of
a 0-length allocation is fine. (And the 0-length allocation behvaior on realloc
is undefined.. may either return a pointer or NULL.)
Signed-off-by: Sage Weil <sage@redhat.com>
Fixes the coverity scan report:
CID 1411830: Uninitialized pointer field (UNINIT_CTOR)
2. uninit_member: Non-static class member completion is not initialized in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member comp is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Jos Collin <jcollin@redhat.com>
An osd is safe to destroy if
- we have osd_stat for it
- osd_stat indicates no pgs stored
- all pgs are known
- no pgs map to it
An osd is ok ot stop if
- we have pg stats
- no pgs will drop below min_size
Signed-off-by: Sage Weil <sage@redhat.com>
When loading an onode from kraken we have a compat path that calls
get_ref before the SharedBlob pointer is initialized. This is fine except
that if debugging is enabled the operator<< on the Blob will segv on
printing *b.shared_blob (which is NULL).
Fix operator<< to print something else if it is NULL. shared_blob does
get set up right after the call to decode() so having it be NULL at this
point is otherwise harmless.
Fixes: http://tracker.ceph.com/issues/20977
Signed-off-by: Sage Weil <sage@redhat.com>
If we are cloning a blob for a 1 byte logical extent then dirty_range_begin
will equal _end and we won't dirty the source onode (with possibly newly
shared blobs).
Fix by using a separate flag to indicate whether we are dirtying instead
of overloading the begin/end markers for this. Note that even if they
are equal dirty_range will still dirty the shard in question.
This is a result of 0ae5d92d42.
Fixes: http://tracker.ceph.com/issues/20983
Signed-off-by: Sage Weil <sage@redhat.com>
With all upgrades passing through luminous, we can now start
reusing bits retired in luminous. Our sentinel bitmask will be the
combination of SERVER_MIMIC and SERVER_JEWEL (i.e.,
CEPH_FEATUREMASK_SERVER_MIMIC).
Signed-off-by: Sage Weil <sage@redhat.com>
When we build the shadow buckets for the class hierarchies, we need
to fill in the weight-sets for each shadow bucket too.
Skip the ids vector for now since it's not yet used by anything.
Fixes: http://tracker.ceph.com/issues/20939
Signed-off-by: Sage Weil <sage@redhat.com>