Danny Al-Gaaf [Sat, 14 Mar 2015 00:16:31 +0000 (01:16 +0100)]
librbd/AioRequest.h: fix UNINIT_CTOR
Fix for:
CID 1274319: Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_object_state is not
initialized in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Fri, 13 Mar 2015 23:09:22 +0000 (00:09 +0100)]
kv_flat_btree_async.h: fix some UNINIT_CTOR issues
Fix for:
CID 728000: Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member wait_ms is not initialized
in this constructor nor in any functions that it calls.
CID 727995: Uninitialized scalar field (UNINIT_CTOR)
CID 727996: Uninitialized scalar field (UNINIT_CTOR)
CID 727998: Uninitialized scalar field (UNINIT_CTOR)
CID 727999: Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member unwritable is not initialized
in this constructor nor in any functions that it calls.
uninit_member: Non-static class member version is not initialized
in this constructor nor in any functions that it calls.
uninit_member: Non-static class member size is not initialized
in this constructor nor in any functions that it calls.
CID 727997: Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member unwritable is not initialized
in this constructor nor in any functions that it calls.
uninit_member: Non-static class member size is not initialized
in this constructor nor in any functions that it calls.
CID 727994: Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member version is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1274311: Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized element of array
dm_ids when calling shec_make_decoding_matrix.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:
CID 1274310: Uninitialized scalar variable (UNINIT)
6. uninit_use_in_call: Using uninitialized element of
array erased when calling shec_make_decoding_matrix.
CID 1274312: Uninitialized scalar variable (UNINIT)
24. uninit_use_in_call: Using uninitialized element of
array dm_ids when calling shec_make_decoding_matrix.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Fri, 13 Mar 2015 16:21:02 +0000 (17:21 +0100)]
utime.h: fix OVERFLOW_BEFORE_WIDEN
CID 1274295 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression
usec * 1000 with type int (32 bits, signed) is evaluated using
32-bit arithmetic before being used in a context which expects
an expression of type uint64_t (64 bits, unsigned).
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Fri, 13 Mar 2015 12:50:04 +0000 (13:50 +0100)]
blkdev.cc: fix STRING_OVERFLOW
Fix for:
CID 1258439 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
2. fixed_size_dest: You might overrun the 4096 byte fixed-size
string devname by copying dev + 5 without checking the length.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Fri, 13 Mar 2015 11:17:00 +0000 (12:17 +0100)]
test_async_driver.cc: fix NEGATIVE_RETURNS
Fix for:
CID 1254374 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
1. negative_return_fn: Function socket(2, SOCK_STREAM, 0) returns a
negative number.
2. var_assign: Assigning: signed variable connect_sd = socket.
3. negative_returns: connect_sd is passed to a parameter that cannot
be negative.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 12 Mar 2015 21:56:22 +0000 (22:56 +0100)]
osdc/Striper.cc: fix another OVERFLOW_BEFORE_WIDEN
Fix for:
CID 1247720 (#1 of 1): Unintentional integer overflow
(OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression
stripe_count * stripe_unit with type unsigned int (32 bits,
unsigned) is evaluated using 32-bit arithmetic before being
used in a context which expects an expression of type
uint64_t (64 bits, unsigned).
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 12 Mar 2015 21:53:21 +0000 (22:53 +0100)]
osdc/Striper.cc: fix OVERFLOW_BEFORE_WIDEN
Fix for:
CID 1247719 (#1 of 1): Unintentional integer overflow
(OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression
stripe_count * object_size with type unsigned int (32 bits,
unsigned) is evaluated using 32-bit arithmetic before being
used in a context which expects an expression of type
uint64_t (64 bits, unsigned).
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 12 Mar 2015 20:55:33 +0000 (21:55 +0100)]
test_librbd.cc: fix USE_AFTER_FREE
Fix for:
CID 1251462 (#1 of 1): Use after free (USE_AFTER_FREE)
1. alias: Assigning: cur_name = names. Now both point to the same storage.
3. freed_arg: free frees names.
6. pass_freed_arg: Passing freed pointer cur_name as an argument to printf.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 12 Mar 2015 16:47:57 +0000 (17:47 +0100)]
auth/Auth.h: mark constructor as explicit
Fix for cppcheck warning:
Struct 'AuthAuthorizer' has a constructor with 1 argument that is
not explicit. Such constructors should in general be explicit for
type safety reasons. Using the explicit keyword in the constructor
means some mistakes when using the class can be avoided.
For more information check:
http://www.tantalon.com/pete/cppopt/asyougo.htm#UseExplicitConstructors
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Raju Kurunkad [Tue, 10 Mar 2015 07:58:28 +0000 (13:28 +0530)]
XIO: Handle requeue case of XIO messages
If we are not able to send the XIO message using xio_send_msg(),
remove the XIO message from the send Q, before queuing it to the resend
Q. Otherwise, boost will generate a assert.
Loic Dachary [Wed, 4 Mar 2015 12:47:37 +0000 (13:47 +0100)]
tests: install-deps.sh install EPEL and RHEL Optional
On CentOS and RHEL, some dependencies come from EPEL.
Always enable RHEL Optional repository for RHEL as packages such as
packages such as libatomic_ops-devel or libedit-devel are only found
there in RHEL 6.5.
Michal Jarzabek [Thu, 5 Mar 2015 18:01:05 +0000 (18:01 +0000)]
mon/OSDMonitor: refactor and new key "all" for osd pool get command
This will only output all the values applicable to a given type of pool.
So for example for a pool that is not a tier pool values like HIT_SET_TYPE,
HIT_SET_PERIOD, HIT_SET_COUNT etc. will be ignored.
Fixes: #10891 Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
Loic Dachary [Mon, 9 Mar 2015 14:41:21 +0000 (15:41 +0100)]
deb: add zlib1g-dev to Build-Depends for Debian/jessie
The zlib1g-dev is installed indirectly for Ubuntu 12.04 or Ubuntu 14.04
but it is only suggested in Debian/jessie. Adding it to the
Build-depends is redundant and harmless for Ubuntu and resolves the
missing dependency for Debian.
Loic Dachary [Mon, 9 Mar 2015 11:56:31 +0000 (12:56 +0100)]
tests: increase the delay waiting for a cluster event
In some cases the machine running tests may be slow enough that it takes
more than a minute for an OSD to come up. It only happens rarely and
changing the wait period from 60 seconds to 120 seconds. Is so slow
that it takes more than 2 minutes to bring an OSD up, chances are a lot
more will go wrong anyway.
Jianpeng Ma [Mon, 9 Mar 2015 06:23:23 +0000 (14:23 +0800)]
librbd: Add a paramter:purge_on_error in ImageCtx::invalidate_cache().
If bh_write met error, it will try again. For closing image, if met this
issue, it will trigger a assert:
>>2015-02-03 15:22:49.198292 7ff62d537800 -1 osdc/ObjectCacher.cc: In
function 'ObjectCacher::~ObjectCacher()' thread 7ff62d537800 time
>>2015-02-03 15:22:49.195927osdc/ObjectCacher.cc: 551: FAILED
>>assert(i->empty())
Now add purge_on_error, when shutdown_cache it set true.
In ImageCtx::invalidate_cache, if met error and purge_on_error is true,
purge the dirty bh.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Jianpeng Ma [Fri, 6 Feb 2015 01:53:36 +0000 (09:53 +0800)]
osdc: For trust_enoent is true, there is only one extent.
Now the judgement only in conditon which will return -ENOENT.
But o->exists don't depend on the extent size. It only depend on
trust_enoent. So move this judgement at the first of _readx().
Make this bug ASAP occur.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Samuel Just [Sat, 7 Mar 2015 02:02:25 +0000 (18:02 -0800)]
ReplicatedPG: block write on degraded object if there are waiters
Suppose we have min_size of 2 and size of 3, foo exists only on the
primary.
- block op 1 on foo due to < min_size
- start recovery on foo for replicas 1 and 2
- complete push to replica 1 (2 copies now)
- allow op 2 on foo through since we have 2 copies
- complete recovery on foo, requeue op 1
Fixes: 11057 Signed-off-by: Samuel Just <sjust@redhat.com>
Sage Weil [Sat, 7 Mar 2015 01:43:11 +0000 (17:43 -0800)]
crush: parse alg names that include a digit
The str_p("straw2") won't parse straw2, it seems because the digit is throwing
it off. Use the existing name rule instead which is more robust. Note that
not constraining the alg value here is better anyway because instead of a
'cannot parse' error that is hard to debug we instead get a 'unknown alg foo'
error when doing the semantic pass.
Fixes: #11015 Signed-off-by: Sage Weil <sage@redhat.com>
Loic Dachary [Thu, 5 Mar 2015 10:38:18 +0000 (11:38 +0100)]
install-deps.sh: strip | in the list of packages
Alternatives were introduced lately and the | needs to be stripped from
the list of packages to install otherwise apt-get will try to install
all packages.