Commit Graph

42244 Commits

Author SHA1 Message Date
Kefu Chai
06e6c15217 test/perf_local: disable tests if not supported
* pass appropriate "-m<machine>" args to compiler

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 14:58:57 +08:00
Kefu Chai
63343cef77 .gitignore: ignore /perf_perf_local
Fixes: #11827
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 14:58:52 +08:00
Haomai Wang
168354c6e0 test_msgr: make available_conns only can own unique (server,client) messenger pair
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-06-01 14:52:15 +08:00
Haomai Wang
55e7cb9cd5 Message: Make encode_payload can be reentrant
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-06-01 14:50:45 +08:00
Yan, Zheng
17b2c5b5a6 mds: use helper functions to access/modify SnapRealm::open
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-06-01 14:09:47 +08:00
Yan, Zheng
c3fa768db8 mds: remove pruned parent snaprealm from snaprealm's open_past_parents
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-06-01 14:09:22 +08:00
Yan, Zheng
55063a9fdf mds: fix CInode::pop_projected_snaprealm()
CInode::pop_projected_snaprealm() was called after calling
CDentry::pop_projected_linkage(). So get_parent_inode()->find_snaprealm()
is not past parent snaprealm. The fix is set snaprealm->open to 'false'
and let SnapRealm::_open_parents() open the new past parent.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-06-01 14:05:44 +08:00
Yan, Zheng
6ed6a68e62 mds: properly open parents of snaprealm
make sure snaprealm's parents are opened before building
cached_snaps/cached_snap_context/cached_snap_trace

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-06-01 14:02:48 +08:00
Danny Al-Gaaf
cc1ff9b456 test/librbd/fsx.cc: fix int/unsigned long conversion
getnum() returns an integer while maxfilelen is a unsinged long.
Use a temp var to be able to check the result of the call.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
05b050f0b6 mds/CInode.cc: fix FORWARD_NULL issue
Don't check for the conditions used inside get_projected_parent_dn(),
simply check if the returned value is valid.

Fix for:

CID 716915: Dereference after null check (FORWARD_NULL)
 var_deref_model: Passing null pointer this->get_projected_parent_dn()
 to pre_dirty, which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
0ae8fcadfb os/HashIndex.cc: add asserts to prevent BAD_SHIFT
Fix for:

CID 1232599: Bad bit shift operation (BAD_SHIFT)
 negative_shift: In expression i << (4 - split_bits) % 4, shifting by
 a negative amount has undefined behavior. The shift amount,
 (4 - split_bits) % 4, is -1.

CID 1232600: Bad bit shift operation (BAD_SHIFT)
 negative_shift: In expression 1 << pg_num_bits - 1, shifting by a
 negative amount has undefined behavior. The shift amount,
 pg_num_bits - 1, is -1.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
f5ae56b57c osd/ClassHandler.cc: fix STRING_OVERFLOW
CID 1058792 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
 fixed_size_dest: You might overrun the 4097 byte fixed-size string
 cname by copying &pde->d_name[8UL] - 1 without checking the length.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
0a45a7a19e test/librbd/fsx.cc: fix BUFFER_SIZE_WARNING
CID 1296375 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
 buffer_size_warning: Calling strncpy with a maximum size argument of
 1024 bytes on destination array logfile of size 1024 bytes might leave
 the destination string unterminated.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
bbeb37fc4d tools/rados/rados.cc: restore ostream precision format
CID 717135 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
1. format_changed: precision changes the format state of std::cout for
   category precision.
4. end_of_path: Changing format state of stream std::cout for category
   precision without later restoring it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
6ffec51880 tools/rados/rados.cc: restore ostream precision format
CID 717134 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
4.  format_changed: precision changes the format state of std::cout
    for category precision.
26. end_of_path: Changing format state of stream std::cout for category
    precision without later restoring it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
3b720f5a62 tools/rados/rados.cc: restore ostream format
CID 717133 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
95.  format_changed: fill changes the format state of std::cout for
     category fill.
100. end_of_path: Changing format state of stream std::cout for
     category fill without later restoring it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
71df303a90 mon/OSDMonitor.cc: suppress false positive MISSING_BREAK
Suppress coverity issue:

CID 1193085 (#1 of 1): Missing break in switch (MISSING_BREAK)
 unterminated_case: This case (value -114) is not terminated by a
 'break' statement.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
42f93a6418 os/FileStore.cc: remove dead code
Fix for coverity issue caused by 8811df3 (introduced a similar
check some lines earlier in the code causing the check to return
earlier).

at_least: At condition r < 0, the value of r must be at least 0.
dead_error_condition: The condition r < 0 cannot be true.

CID 1274289 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
258b7b9a31 rgw/rgw_rados.cc: remove dead code
CID 1274290 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement return r;.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
af144371f0 test/librbd/fsx.cc: reduce scope of variables
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
83cb6095dd mds/MDS.cc: silence coverity DIV_BY_ZERO
Silence coverity: ls.empty() check should already imply that
ls.size() != 0.

CID 1295402 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
 divide_by_zero: In expression rand() % ls.size(), modulo by
 expression ls.size() which may be zero has undefined behavior.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:26 +02:00
Danny Al-Gaaf
958289b0f9 test/librbd/fsx.cc: fix format specifier
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:25 +02:00
Danny Al-Gaaf
b705949a61 test_internal.cc: prefer ++operator for non-primitive iter
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:25 +02:00
Danny Al-Gaaf
e60c9c2213 rgw/rgw_op.cc: prefer empty() over 'size() == 0' for emptiness check
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:25 +02:00
Danny Al-Gaaf
d312847336 librbd/internal.cc: close resource leak
Fix for:

CID 1295405 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Variable req_comp going out of scope leaks
 the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-06-01 06:59:25 +02:00
Loic Dachary
7e2a7a8685 tests: cephtool/test.sh wait_for_clean after PG (re)mapping
A get/set command may fail with

   Error EBUSY: currently creating pgs, wait

if issued before the PGs are clean. Call wait_for_clean after the pool
is created or a pool setting is changed and remaps the PGs it
contains (size, pg_num...) to ensure the PGs are clean and the set/get
command that follow will succeed.

http://tracker.ceph.com/issues/11624 Fixes: #11624

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-06-01 01:13:44 +02:00
Loic Dachary
f6e4000589 tests: reduce pg_num in test_mon_osd_pool_set
No need for more than one pg to test get/set on pools: it also is faster
to become clean.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-06-01 01:13:44 +02:00
Loic Dachary
d2cc2b184b tests: use get_pg from ceph-helpers.sh
The semantic and interface of get_pg are the same, that avoids
duplication and the ceph-helpers.sh version is tested and documented.

Make the ceph-test package dependent on xmlstarlet because it is
needed by ceph-helpers.sh.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-06-01 01:11:28 +02:00
Sage Weil
7d6bef7cbe COPYING: note git-archive-all.sh license
Signed-off-by: Sage Weil <sage@redhat.com>
2015-05-31 18:25:59 -04:00
Sage Weil
31e93908c9 make_dist.sh: rename from bin/make_dist_tarball.sh
Signed-off-by: Sage Weil <sage@redhat.com>
2015-05-31 17:58:49 -04:00
Sage Weil
f3fe18a60c make_dist_tarball.sh: make gz and bz2 archives
Signed-off-by: Sage Weil <sage@redhat.com>
2015-05-31 17:57:41 -04:00
Loic Dachary
8e1bcf21f0 ceph-disk: always check zap is applied on a full device
zap only makes sense on a full device and this is verified for

    ceph-disk prepare --zap-disk

but not for

    ceph-disk zap

Unify the two and add a test to check that it fails as expected when
trying to zap a directory.

http://tracker.ceph.com/issues/11272 Fixes: #11272

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-05-31 19:42:45 +02:00
Kefu Chai
c6e6348753 mon: add "--check" to CrushTester::test_with_crushtool()
so we don't need to call CrushTester::check_name_maps() in OSDMonitor.cc
anymore.

Fixes: #11680
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Kefu Chai
9381d53acd crushtool: rename "--check-names" to "--check"
* because "--check" also checks for the max_id

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Kefu Chai
22e6bd6e01 mon: check the new crush map against osdmap.max_osd
Fixes: #11680
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Kefu Chai
d0658dd3cd crushtool: enable check against max_id
add an argument "max_id" for "--check-names" to check if any item
has an id greater or equal to given "max_id" in crush map.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Kefu Chai
e640d89240 crush/CrushTester: check if any item id is too large
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Kefu Chai
a955f36a50 mon: validate new crush for unknown names
* the "osd tree dump" command enumerates all buckets/osds found in either the
  crush map or the osd map. but the newly set crushmap is not validated for
  the dangling references, so we need to check to see if any item in new crush
  map is referencing unknown type/name when a new crush map is sent to
  monitor, reject it if any.

Fixes: #11680
Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Kefu Chai
d6b46d4c7b crushtool: add the "--check-names" option
* so one is able to verify that the "ceph osd tree" won't chock on the
  new crush map because of dangling name/type references

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Kefu Chai
b75384d739 crush/CrushTester: add check_name_maps() method
* check for dangling bucket name or type names referenced by the
  buckets/items in the crush map.
* also check for the references from Item(0, 0, 0) which does not
  necessarily exist in the crush map under testing. the rationale
  behind this is: the "ceph osd tree" will also print stray OSDs
  whose id is greater or equal to 0. so it would be useful to
  check if the crush map offers the type name indexed by "0"
  (the name of OSDs is always "OSD.{id}", so we don't need to
  look up the name of an OSD item in the crushmap).

Signed-off-by: Kefu Chai <kchai@redhat.com>
2015-06-01 01:24:54 +08:00
Sage Weil
c8705e5ae5 Merge remote-tracking branch 'gh/next' 2015-05-31 12:43:33 -04:00
Sage Weil
f5a95804af unittest_ceph_argparse: test float parsing
Signed-off-by: Sage Weil <sage@redhat.com>
2015-05-31 12:43:01 -04:00
Rajesh Nambiar
4487d13cc6 Allow float value by allowing . in input value
Dont bail out if the input value happens to be .

Fixes: #11620
Signed-off-by: Rajesh Nambiar <rajesh.n@msystechnologies.com>
Tested-by: Sage Weil <sage@redhat.com>
2015-05-31 12:38:03 -04:00
Loic Dachary
64944d4105 tests: ceph-helpers.sh use expr instead of (( ))
Because (( timer++ )) is mistaken by set -e to not be a successful
command, use expr instead.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-05-31 18:33:20 +02:00
Loic Dachary
d2172b0e89 tests: move ceph-helpers.sh to qa/workunits
So that it can be used by scripts in qa/workunits that need it.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-05-31 18:33:17 +02:00
Haomai Wang
b8954e6efb AsyncConnection: Make header insert when sending
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
2015-05-31 11:03:44 +08:00
Loic Dachary
a199ff9d59 erasure-code: ErasureCodeShec update default values to string
Update the ErasureCodeShec::init function to use string default
values. The default profile values for technique, ruleset-root and
ruleset-failure-domain are set for the user to see.

The error message when an invalid technique is provided is written to
the error stream to be returned to the user instead of being written to
the OSD log.

Updating other values from the profile would require deeper changes and
is left for later.

http://tracker.ceph.com/issues/9589 Fixes: #9589

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-05-31 00:01:34 +02:00
Loic Dachary
395eba9b38 erasure-code: ErasureCodeLrc update default values to string
Update the ErasureCodeLrc::init function to use string default values
and update the profile accordingly.

If the k,m,l values are set and generate mappings and layers entries,
those are not stored in the profile. The details of what k,m,l create
are private and not exposed to the caller.

http://tracker.ceph.com/issues/9589 Fixes: #9589

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-05-31 00:01:34 +02:00
Loic Dachary
17ecd6f942 erasure-code: return ErasureCodeLrc::parse_kml error
Instead of always returning 0

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-05-31 00:01:34 +02:00
Loic Dachary
14a59e5a2c erasure-code: ErasureCodeJerasure update default values to string
Update the ErasureCodeJerasure::init function to use string default values
and update the profile accordingly.

The ErasureCodeJerasure::revert_to_default prototype is modified so it
can update the profile.

http://tracker.ceph.com/issues/9589 Fixes: #9589

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-05-31 00:01:34 +02:00