Sage Weil [Thu, 5 Jun 2014 17:43:16 +0000 (10:43 -0700)]
include/atomic: make 32-bit atomic64_t unsigned
This fixes
In file included from test/perf_counters.cc:19:0:
./common/perf_counters.h: In member function ‘std::pair PerfCounters::perf_counter_data_any_d::read_avg() const’:
warning: ./common/perf_counters.h:156:36: comparison between signed and unsigned integer expressions [-Wsign-compare]
} while (avgcount2.read() != count);
^
Sage Weil [Thu, 5 Jun 2014 18:56:58 +0000 (11:56 -0700)]
ceph-objectstore-test: fix warning in collect_metadata test
In file included from test/objectstore/store_test.cc:33:0:
../src/gtest/include/gtest/gtest.h: In function ‘testing::AssertionResult testing::internal::CmpHelperNE(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int, T2 = int]’:
test/objectstore/store_test.cc:82:5: instantiated from here
warning: ../src/gtest/include/gtest/gtest.h:1379:1: comparison between signed and unsigned integer expressions [-Wsign-compare]
Danny Al-Gaaf [Wed, 4 Jun 2014 21:22:18 +0000 (23:22 +0200)]
librbd/internal.cc: check earlier for null pointer
Fix potential null ponter deref, move check for 'order != NULL'
to the beginning of the function to prevent a) deref in ldout() call
and b) to leave function as early as possible if check fails.
[src/librbd/internal.cc:843] -> [src/librbd/internal.cc:865]: (warning)
Possible null pointer dereference: order - otherwise it is redundant
to check it against null.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 4 Jun 2014 21:10:42 +0000 (23:10 +0200)]
test/librbd/fsx.c: fix gcc warning
Initialize pointer with NULL before call posix_memalign() to fix
gcc warning:
test/librbd/fsx.c:1402:13: warning: ‘temp_buf’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
if ((ret = ops->read(&cur_ctx, 0, file_info.st_size, temp_buf)) < 0) {
^
test/librbd/fsx.c:1398:13: warning: ‘good_buf’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
if ((ret = pread(fd, good_buf, file_info.st_size, 0)) < 0) {
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Wed, 4 Jun 2014 20:33:51 +0000 (22:33 +0200)]
common/addr_parsing.c: fix realloc memory leak
Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.
Use a temporary pointer to hold the result of realloc(). In error case
print error and exit, otherwise assign it to the pointer we want to realloc.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Ilya Dryomov [Wed, 4 Jun 2014 13:34:06 +0000 (17:34 +0400)]
automake: add dummy.cc to fix 'make tags'
Commit 421e6c561704 ("test_librbd_fsx: add krbd mode support") added
a requirement for ceph_test_librbd_fsx to be linked with a C++ linker.
Implement it in a way that doesn't break 'make tags'.
We were not breaking out of the loop when we filled up the buffer unless
we happened to do so on a pool name boundary. This means that len would
roll over (it was unsigned). In my case, I was not able to reproduce
anything particularly bad since (I think) the strncpy was interpreting the
large unsigned value as signed, but in any case this fixes it, simplifies
the arithmetic, and adds a simple test.
- use a single 'rl' value for the amount of buffer space we want to
consume
- use this to check that there is room and also as the strncat length
- rely on the initial memset to ensure that the trailing 0 is in place.
Fixes: #8447 Signed-off-by: Sage Weil <sage@inktank.com>
Loic Dachary [Tue, 3 Jun 2014 11:05:19 +0000 (13:05 +0200)]
documentation: update osd pool create erasure
The properties are replaced with erasure code profiles. Remove the
reference to properties and the documentation of each erasure-code
related property.
Josh Durgin [Tue, 3 Jun 2014 00:34:50 +0000 (17:34 -0700)]
librbd: clarify license header
These were meant to say LGPL, but a typo was propagated and it
referred to the non-existent GPL2.1, and also to COPYING which
correctly indicated these files were LGPL2.1.
sushma [Wed, 28 May 2014 22:27:54 +0000 (15:27 -0700)]
RadosClient: Avoid the DispatchQueue for OSD responses.
Prior to this change, reader thread puts the response on the DispatchQueue
and Dispatcher thread would call librados callbacks (C_aio_Ack, C_Safe_Cond).
The single DispatchQueue and Dispatcher thread (per client) would become
a bottleneck with multiple OSDs in the cluster.
Similar to fast-dispatch changes on the OSD, DispatchQueue/thread are removed
and librados internal callbacks will be called from reader thread context.
Ilya Dryomov [Tue, 27 May 2014 14:35:36 +0000 (18:35 +0400)]
qa: catch up with xfstests changes
Back in 2013 xfstests were rearranged, which also changed the way
./check parses test lists. Catch up with those changes. Note that
tests can no longer be listed in ranges, we only accept individual
tests and test groups (e.g. -g quick).
Ilya Dryomov [Fri, 30 May 2014 09:37:04 +0000 (13:37 +0400)]
qa: cp run_xfstests.sh run_xfstests-obsolete.sh
run_xfstests.sh is going to be updated in the next commit to be able to
drive newer xfstests. Among other things, the new xfstests proper
doesn't support listing tests in ranges, which is what the qemu wrapper
(run_xfstests_qemu.sh) relies on. So keep a copy of the old
run_xfstests.sh around until the qemu vm image is regenerated and the
up-to-date exclusion list for that kernel is shaken out.
common/config.cc: allow integer values to be parsed as SI units
We are allowing this for all and any integer values; that is, OPT_INT,
OPT_LONGLONG, OPT_U32 and OPT_U64.
It's on the user to use appropriate units. For instance, the user should
not use 'E(xabyte)' when setting a signed int, and use his best judgment
when setting options that, for instance, ought to receive seconds.
Fixes: 8265 Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Loic Dachary [Wed, 28 May 2014 13:36:57 +0000 (15:36 +0200)]
osd: loop over uint8_t instead of shard_id_t
When looping in the range [0,number of shards[ using a uint8_t variable
which is an integer instead of shard_id_t. The alternative would be
define the ++ operator on shard_id_t but since the two are used
interchangeably in a number of places, that seems unnecessary.
Loic Dachary [Thu, 29 May 2014 21:11:48 +0000 (23:11 +0200)]
osd: factorize shard_id_t/shard_t into a struct
The struct contains a single uint8_t and is preferred to control
conversions that would otherwise be implicit. There is no difference
between shard_id_t and shard_t. The definition is moved in
include/types.h so it is available to both hobject.h and osd_types.h