Avoids coverity warning
CID 717214: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "m_shutdown_fd" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
This makes coverity happy.
CID 716963: Data race condition (MISSING_LOCK)
At (1): Accessing "this->data.finished" ("bench_data.finished") requires the "Mutex._m" lock.
Signed-off-by: Sage Weil <sage@inktank.com>
This is useless excepto make coverity happy.
CID 717075: Resource leak (RESOURCE_LEAK)
At (12): Variable "bt" going out of scope leaks the storage it points to.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717020: Out-of-bounds read (OVERRUN)
At (3): Overrunning array "addr->__in6_u.__u6_addr8" of 16 bytes at byte offset 16 using index "prefix_len / 8U" (which evaluates to 16).
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717074: Resource leak (RESOURCE_LEAK)
At (26): Variable "buf" going out of scope leaks the storage it points to.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717213: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "data" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717129: Not restoring ostream format (STREAM_FORMAT_STATE)
At (51): Changing format state of stream "out" for category fill without later restoring it.
Signed-off-by: Sage Weil <sage@inktank.com>
At (2): Non-static class member "m_version_hook" is not initialized in this constructor nor in any functions that it calls.
CID 717212: Uninitialized pointer field (UNINIT_CTOR)
At (4): Non-static class member "m_help_hook" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
This makes coverity happier:
CID 716941: Using invalid iterator (INVALIDATE_ITERATOR)
At (35): Dereferencing iterator "p" though it is already past the end of its container.
only because it doesn't understand all the side-effects of the failure
branch above.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 716847: Other violation (CHECKED_RETURN)
At (5): Calling function "fcntl(sock_fd, 2, 1)" without checking return value. This library function may fail and return an error code.
At (6): No check of the return value of "fcntl(sock_fd, 2, 1)".
Signed-off-by: Sage Weil <sage@inktank.com>
This makes coverity happier:
CID 727967: Value not atomically updated (ATOMICITY)
At (44): Using an unreliable value of "hb" inside the second locked section. If the data that "hb" depends on was changed by another thread, this use might be incorrect.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 717211: Uninitialized scalar field (UNINIT_CTOR)
At (18): Non-static class member field "last.mmap" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
Check that allow_all() returns false when 'allow *' is not specified.
This would have caught #3228.
Add tests for the output operators as well.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
OSD_CAP_ANY is not a mask. Treating it as one made any allowance
equivalent to 'allow *'.
Fixes: #3228
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
OSD_CAP_ANY is not a flag, but a value (0xff) that will always
be true when treated as a mask with a non-zero rwxa_t.
Don't duplicate the rwxa_t output operator in the OSDCapSpec output
operator, just use it.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This moves the shutdown of the messenger outside of the client
to be able to handle error cases more appropriately.
Signed-off-by: Sam Lang <sam.lang@inktank.com>
Add perf counters tracking the number of inbound pushes along with the
amount of data in each request.
Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
Previously, we considered backfill_pos degraded in order to delay
ops since a write to backfill_pos could generate a snap before
backfill_pos, and we assume that (0, backfill_pos) is fully
backfilled. This is a problem since it's possible that
backfill_pos is a valid object, but not one that currently exists.
For example, it might have been deleted since last_backfill was
last changed. Instead, we will explicitly delay ops on
backfill_pos in waiting_for_backfill_pos.
This error resulted in #2691 since wait_for_degraded_object also
attempts to recover the object. At this point, the primary would
attempt to recover the object, find that it isn't there, and put
it in the missing set with need=0,0. Eventually, recover_primary
attempts to recover that object, finds that it has been deleted
in the log, and asserts.
Signed-off-by: Samuel Just <sam.just@inktank.com>
When we encounter a divergent log entry, we put the
object into the missing set at the prior_version
for the divergent event. Unfortunately, the event
at prior_version might have been trimmed leaving
the missing set with an item with a need prior to
log_tail. Thus, last_complete also ends up being
prior to log_tail.
Caused #3208.
There is another bug related to this one: #3213.
Signed-off-by: Samuel Just <sam.just@inktank.com>
When copying an object with new attrs, we still need to
maintain the ETAG.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Conflicts:
src/rgw/rgw_rados.cc
Parsing has side effects that must be undone if it fails. A
capability string like 'allow rwx pool=bar' will add the grant for
'allow rwx' and then fail on the 'pool=bar'. Thus, the client will
effectively have 'rwx' permissions on all pools.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
The OSD processes only a single string. The existing example wouldn't
even be passed to the OSD, since it would be interpreted as an option
to the ceph command.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
A failure in the ceph tool -> osd connection may mean this command is sent
twice. This regularly causes failures in QA.
Signed-off-by: Sage Weil <sage@inktank.com>