radosgw depends on libresolv since since the commit 951c6be. So we need to
add -lresolve flags, or it cannot link right library.
Signed-off-by: Chen Baozi <baozich@gmail.com>
Avoid using shared-state rand() when picking monitors. This way we don't
screw with library users like test_librbd_fsx that rely on srand() and
rand() being deterministic.
Signed-off-by: Sage Weil <sage@inktank.com>
Starter helper will start all osds that appear in /var/lib/ceph/osd/*,
as we do with the mons and mdss.
This will only proceed if the 'ready' file is there, which is currently
only touched by ceph-disk-activate.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 743400 (#1 of 1): Missing unlock (LOCK)
At (5): Returning without unlocking "this->client_lock._m".
CID 743399 (#1 of 1): Missing unlock (LOCK)
At (5): Returning without unlocking "this->client_lock._m".
Signed-off-by: Sage Weil <sage@inktank.com>
It is possible for rebind() to fail, in which case the OSD will go through
it's shutdown procedure and call stop(). This is simpler than trying to
avoid calling stop() when rebind() fails.
Fixes: #3504
Signed-off-by: Sage Weil <sage@inktank.com>
This error left a completion that should have been attached
to the right BufferHead on the left BufferHead, which would
result in the completion never being called unless the buffers
were merged before it's original read completed. This would cause
a hang in any higher level waiting for a read to complete.
The existing loop went backwards (using a forward iterator),
but stopped when the iterator reached the beginning of the map,
or when a waiter belonged to the left BufferHead.
If the first list of waiters should have been moved to the right
BufferHead, it was skipped because at that point the iterator
was at the beginning of the map, which was the main condition
of the loop.
Restructure the waiters-moving loop to go forward in the map instead,
so it's harder to make an off-by-one error.
Possibly-fixes: #3286
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
If the desired offset overlaps a BH, data.lower_bound() will return
the element after it, since it's indexed by the start of a range.
The confusingly similarly named data_lower_bound() method fixes this,
and returns the correct starting element.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This isn't called because it's potentially expensive, but calling it
in various places can help future debugging.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This iterator is now reset on each run through the loop,
so there's no point in incrementing it here.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Skipping these callbacks when there's a racing write or
a gap in the results causes the original reads they represent
to never be completed. If the read falls within the range
of a BufferHead, retry all waiters no matter what.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Adding a new ops log output (into a unix domain socket).
Configuration:
rgw_enable_usage_log : master switch for ops log
rgw ops log socket path : set socket path
rgw ops log rados : whether ops should be logged in the rados
cluster
rgw ops log data backlog : max size in MB to be accumulated
without flushing
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
CID 743418 (#1 of 1): Dereference before null check (REVERSE_INULL)
Null-checking "argv" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 743433 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "authorize_handler_registry" is not initialized in this constructor nor in any functions that it calls.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 743405 (#2 of 2): Resource leak (RESOURCE_LEAK)
At (16): Handle variable "fd" going out of scope leaks the handle.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 743406 (#3 of 3): Resource leak (RESOURCE_LEAK)
At (26): Handle variable "fd" going out of scope leaks the handle.
Signed-off-by: Sage Weil <sage@inktank.com>
CID 743435 (#1 of 1): Use after free (USE_AFTER_FREE)
At (68): Passing freed pointer "rd" as an argument to function "std::basic_ostream<char, std::char_traits<char> >::operator <<(void const *)".
Signed-off-by: Sage Weil <sage@inktank.com>
Use a fake writeback handler and respond to all requests with -ENOENT.
This tests that all operations will complete, and the cache doesn't
lose waiters or callbacks.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
There is a difference in naming conventions between debian and
rpm based distributions for this library. In configure.ac we
check first for boost_thread-mt, then if it's not found check
for boost_thread. A side effect of the AC_CEHCK_LIB macro is
to add the library to the $LIBS, so the explicit -llibboost_thread
in the Makefile has been removed.
(cherry picked from commit f0c7bb3630)
There is a difference in naming conventions between debian and
rpm based distributions for this library. In configure.ac we
check first for boost_thread-mt, then if it's not found check
for boost_thread. A side effect of the AC_CEHCK_LIB macro is
to add the library to the $LIBS, so the explicit -llibboost_thread
in the Makefile has been removed.
Only try to create a btrfs subvolume if the fs is btrfs. Otherwise, just
create a directory. Then we can error out on *any* ioctl error, and not
rely on the ioctl error code to determine if we failed because we are on
a non-btrfs or a real error.
Fixes: #3052
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
get_item_id() returns 0 if the name already exists; that's not what we
want here. Verify the name exists before checking its id.
Signed-off-by: Sage Weil <sage@inktank.com>