The Incremental encode stashes encode_features, which is
what we use later to reencode the updated OSDMap. Use
the same features so that the encoding will match!
Signed-off-by: Sage Weil <sage@redhat.com>
When clang uses an 8 bit type for the enum, it
complains (out of range) if comparing <256,
and complains (tautological) if comparing <=256.
Avoid this by explicitly making the enum an
uint8_t, and just asserting that that it has
that size at the point that we assume so for
the encoding (in case someone modified the
type definition without checking how it was used).
Signed-off-by: John Spray <john.spray@redhat.com>
Run a command: "ceph tell osd.0 query", and it outputs the following
error message:
Error EINVAL: unrecognized command! [{"prefix": "query"}]
In fact, the command "query" exists, but it requires one more input
parameter "pgid", therefore the following error information will be
more appropriate:
Error EINVAL: no pgid specified
In this patch, we check the parameter pgid after recognizing a command
(like "query" or "list_missing"), rather than before it.
Signed-off-by: Javeme <javaloveme@gmail.com>
CDir::log_mark_dirty() moves dirfrag to current log segment's dirty
dirfrag list, but it does not submit any log event. Old log segments
(that include events which dirty the dirfrag) may get expired before
the dirfrag gets committed. If MDS crashes, the changes in expired
log segments get lost.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
For each log event, mds allocate two extra contexts, one for
marking op tracker event, one for updating log's safe_pos after
executing the finish context. This is sub-optimization.
This patch defines MDSLogContextBase for log event context.
MDSLogContextBase::complete() function can do the extra jobs.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
cmake: link tests against static librados
Reviewed-by: Loic Dachary <ldachary@redhat.com>
Reviewed-by: Ali Maredia <amaredia@redhat.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Fixes: http://tracker.ceph.com/issues/17635
Before accessing json entity, need to check that iterator is valid.
If there is no entry return appropriate error code.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
When ceph-* drops drops privileges via setuid, core dumps are no longer
generated because its DUMPABLE flag is cleared. We have to manually
turn that back on.
From prctl(2):
Normally, this flag is set to 1. However, it is reset to the current value contained in the file /proc/sys/fs/suid_dumpable (which by default has the value 0), in the fol‐
lowing circumstances:
* The process's effective user or group ID is changed.
* The process's filesystem user or group ID is changed (see credentials(7)).
* The process executes (execve(2)) a set-user-ID or set-group-ID program, or a program that has capabilities (see capabilities(7)).
Fixes: http://tracker.ceph.com/issues/17650
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Passing by value tries to copy from a null and segfaults.
Fixes: http://tracker.ceph.com/issues/17636
Signed-off-by: John Spray <john.spray@redhat.com>
prior to this change, librbd tests link against librados_api_obj and
librados_objs, but since librados_a offers all the goodies, we can
just link against it instead.
Signed-off-by: Kefu Chai <kchai@redhat.com>
so tests referencing internal symbols can use librados_a instead of
librados to avoid violating ODR (one definition rule).
Fixes: http://tracker.ceph.com/issues/17260
Signed-off-by: Kefu Chai <kchai@redhat.com>
Callers expect run_in_thread() to return a tuple, but it
returns an int. When interrupt the function it would raise
an iterable exception.
This patch fix the bug, and it would just output a message
like: "Error EINTR: Interrupted!"
Signed-off-by: Javeme <javaloveme@gmail.com>