]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agoerasure-code: add ostream to factory()
Loic Dachary [Sun, 16 Mar 2014 11:22:02 +0000 (12:22 +0100)]
erasure-code: add ostream to factory()

Modify calls to ErasureCodePlugin::factory() to provide the new
ostream argument.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agoerasure-code: remove dependency to the global context
Loic Dachary [Sun, 16 Mar 2014 11:14:30 +0000 (12:14 +0100)]
erasure-code: remove dependency to the global context

Instead of relying on derr to display error messages, add them to an
ostream parameter given in argument to load() and factory(). The erasure
code convenience library no longer depends on the global context that is
indirectly referenced by debug.h

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agocommon,erasure-code,mon: s/erasure-code-//
Loic Dachary [Sun, 16 Mar 2014 11:09:51 +0000 (12:09 +0100)]
common,erasure-code,mon: s/erasure-code-//

The parameters to erasure code do not need to be prefixed with the
erasure-code- string. There only are erasure-code parameters and the
prefix was originaly intended to desambiguate the erasure-code
properties, assuming that the properties map could be used for other
purposes.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon,osd,erasure-code: update copyright notices
Loic Dachary [Sun, 16 Mar 2014 11:03:10 +0000 (12:03 +0100)]
mon,osd,erasure-code: update copyright notices

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: tests for pool create erasure implicit ruleset creation
Loic Dachary [Mon, 3 Mar 2014 14:40:13 +0000 (15:40 +0100)]
mon: tests for pool create erasure implicit ruleset creation

* Remove the tests checking that a missing or wrong crush_ruleset
  parameters triggered an error.
* Add a test checking that a ruleset with the same name as the pool is
  created implicitly when no crush_ruleset is specified.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: pool create erasure implicit ruleset creation
Loic Dachary [Mon, 3 Mar 2014 14:25:21 +0000 (15:25 +0100)]
mon: pool create erasure implicit ruleset creation

If the crush_ruleset parameter is missing, set it to the pool name.

If the crush_ruleset parameter is set to a name that does not match any
of the existing rulesets, create one using the pool creation parameters.

If the ruleset exists and is in the pending map or if the ruleset was
just created (meaning it exists in the pending map), the
prepare_pool_crush_ruleset method returns EAGAIN so that the pool
creation message is retried after the pending map is proposed.

If the ruleset exists, it is used to initialize the newly created pool,
as before.

http://tracker.ceph.com/issues/7571 fixes #7571

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: add pool name to prepare_pool_crush_ruleset
Loic Dachary [Mon, 3 Mar 2014 14:18:34 +0000 (15:18 +0100)]
mon: add pool name to prepare_pool_crush_ruleset

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: create-erasure uses crush_ruleset_create_erasure
Loic Dachary [Mon, 3 Mar 2014 14:12:53 +0000 (15:12 +0100)]
mon: create-erasure uses crush_ruleset_create_erasure

Create the ruleset and branch depending on the result:

* If it succeeds, wait
* If it already exists and is pending (-EALREADY), wait
* If it already exists (-EEXIST), return immediately
* If it fails for other reasons, return immediately

Add an informative message when it succeeds.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: crush_ruleset_create_erasure s/_map//
Loic Dachary [Mon, 3 Mar 2014 14:12:22 +0000 (15:12 +0100)]
mon: crush_ruleset_create_erasure s/_map//

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: crush_ruleset_create_erasure indent
Loic Dachary [Mon, 3 Mar 2014 14:03:52 +0000 (15:03 +0100)]
mon: crush_ruleset_create_erasure indent

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: crush_ruleset_create_erasure s/rule/err/
Loic Dachary [Mon, 3 Mar 2014 13:55:16 +0000 (14:55 +0100)]
mon: crush_ruleset_create_erasure s/rule/err/

Avoid using rule instead of ruleset to help clarify the
terminology. Using err instead is also clearer in the context.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: crush_ruleset_create_erasure set ruleset
Loic Dachary [Mon, 3 Mar 2014 13:52:20 +0000 (14:52 +0100)]
mon: crush_ruleset_create_erasure set ruleset

Use get_rule_id() instead of rule_exists() to test the existence of a
ruleset and preserve the ruleset.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: crush_ruleset_create_erasure error codes
Loic Dachary [Mon, 3 Mar 2014 13:46:48 +0000 (14:46 +0100)]
mon: crush_ruleset_create_erasure error codes

Replace goto reply with error return and meaningfull error codes.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: crush_ruleset_create_erasure reduce verbosity
Loic Dachary [Mon, 3 Mar 2014 13:43:01 +0000 (14:43 +0100)]
mon: crush_ruleset_create_erasure reduce verbosity

Only add error message to the stream, not informative messages because
they depend on the caller context.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agomon: create crush_ruleset_create_erasure helper
Loic Dachary [Mon, 3 Mar 2014 13:36:50 +0000 (14:36 +0100)]
mon: create crush_ruleset_create_erasure helper

Move the code bloc verbatim, from "osd crush rule create-erasure" to the
new crush_ruleset_create_erasure() method helper. This step helps
separate the code changes from the code moving around unmodified.

Signed-off-by: Loic Dachary <loic@dachary.org>
11 years agoMerge pull request #1462 from ceph/wip-cache-last-epoch-clean
Sage Weil [Sun, 16 Mar 2014 19:57:58 +0000 (12:57 -0700)]
Merge pull request #1462 from ceph/wip-cache-last-epoch-clean

mon: fix caching for min_last_epoch_clean

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Fri, 14 Mar 2014 22:53:10 +0000 (15:53 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

11 years agorados.py: Fixed docstring syntax warnings.
John Wilkins [Fri, 14 Mar 2014 22:52:28 +0000 (15:52 -0700)]
rados.py: Fixed docstring syntax warnings.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agodoc: Fixed release notes syntax warnings.
John Wilkins [Fri, 14 Mar 2014 22:46:16 +0000 (15:46 -0700)]
doc: Fixed release notes syntax warnings.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agodoc: Fixed hyperlink.
John Wilkins [Fri, 14 Mar 2014 22:45:51 +0000 (15:45 -0700)]
doc: Fixed hyperlink.

Fixes: #7558
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
11 years agoMerge pull request #1463 from ceph/wip-7698
David Zafman [Fri, 14 Mar 2014 22:26:43 +0000 (15:26 -0700)]
Merge pull request #1463 from ceph/wip-7698

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agotest: Add ceph_filestore_dump.sh to test ceph_filestore_dump 1455/head 1463/head
David Zafman [Fri, 14 Mar 2014 19:22:02 +0000 (12:22 -0700)]
test: Add ceph_filestore_dump.sh to test ceph_filestore_dump

Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agotools: Fix ceph_filestore_dump to fully operate on EC pools
David Zafman [Wed, 12 Mar 2014 22:31:50 +0000 (15:31 -0700)]
tools: Fix ceph_filestore_dump to fully operate on EC pools

Add spg_t and ghobject_t handling

Fixes: #7698
Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agotools: Cleanups in ceph_filestore_dump
David Zafman [Thu, 13 Mar 2014 06:41:33 +0000 (23:41 -0700)]
tools: Cleanups in ceph_filestore_dump

Fix usage output of ceph_filestore_dump
Add missing error checking
Output full object name
Improve message consistency
Fix program exit value

Signed-off-by: David Zafman <david.zafman@inktank.com>
11 years agomon/OSDMonitor: fix fall-thru case
Sage Weil [Fri, 14 Mar 2014 20:23:01 +0000 (13:23 -0700)]
mon/OSDMonitor: fix fall-thru case

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'gh/firefly'
Sage Weil [Fri, 14 Mar 2014 20:21:51 +0000 (13:21 -0700)]
Merge remote-tracking branch 'gh/firefly'

11 years agomon/PGMap: only recalculate min_last_epoch_clean if incremental touches old min 1462/head
Sage Weil [Sat, 22 Feb 2014 17:35:27 +0000 (09:35 -0800)]
mon/PGMap: only recalculate min_last_epoch_clean if incremental touches old min

If the Incremental updates a value that used to equal the old min, we may
have raised it and need to recalculate it at the end.  Otherwise, we can
avoid recalculating at all!

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomon/PGMap: cache min_last_epoch_clean
Sage Weil [Sat, 22 Feb 2014 17:32:08 +0000 (09:32 -0800)]
mon/PGMap: cache min_last_epoch_clean

We call this a lot.  Only recalculate when we decode or when we apply
an incremental.

Adjust unit test accordingly.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agounittest_mon_pgmap: fix warnings
Sage Weil [Fri, 14 Mar 2014 19:47:59 +0000 (12:47 -0700)]
unittest_mon_pgmap: fix warnings

In file included from test/mon/PGMap.cc:15:0:
../src/gtest/include/gtest/gtest.h: In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = unsigned int]’:
../src/gtest/include/gtest/gtest.h:1300:30: instantiated from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = unsigned int, bool lhs_is_null_literal = false]’
test/mon/PGMap.cc:33:257: instantiated from here
warning: ../src/gtest/include/gtest/gtest.h:1263:3: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agounittest_ceph_argparse: fix warnings
Sage Weil [Fri, 14 Mar 2014 19:46:57 +0000 (12:46 -0700)]
unittest_ceph_argparse: fix warnings

In file included from test/ceph_argparse.cc:17:0:
../src/gtest/include/gtest/gtest.h: In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = long unsigned int]’:
../src/gtest/include/gtest/gtest.h:1333:30: instantiated from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int, T2 = long unsigned int]’
test/ceph_argparse.cc:344:207: instantiated from here
warning: ../src/gtest/include/gtest/gtest.h:1263:3: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agotools/: make filenames consistent
Sage Weil [Fri, 14 Mar 2014 20:15:22 +0000 (13:15 -0700)]
tools/: make filenames consistent

_ for source files, - for (shippable) build targets.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'gh/wip-coverity-20140312'
Sage Weil [Fri, 14 Mar 2014 20:11:23 +0000 (13:11 -0700)]
Merge remote-tracking branch 'gh/wip-coverity-20140312'

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'gh/wip-coverity-20140409'
Sage Weil [Fri, 14 Mar 2014 20:04:21 +0000 (13:04 -0700)]
Merge remote-tracking branch 'gh/wip-coverity-20140409'

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'gh/wip-da-SCA-firefly-20140304'
Sage Weil [Fri, 14 Mar 2014 18:42:30 +0000 (11:42 -0700)]
Merge remote-tracking branch 'gh/wip-da-SCA-firefly-20140304'

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1454 from ceph/wip-7709
Sage Weil [Fri, 14 Mar 2014 18:36:02 +0000 (11:36 -0700)]
Merge pull request #1454 from ceph/wip-7709

osd/ReplicatedPG: release op locks on on commit+applied

Reviewed-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1459 from ceph/wip-7696
Sage Weil [Fri, 14 Mar 2014 18:28:50 +0000 (11:28 -0700)]
Merge pull request #1459 from ceph/wip-7696

Wip 7696

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agodoc/release-notes: note that radosgw's should be upgraded together
Sage Weil [Fri, 14 Mar 2014 18:16:58 +0000 (11:16 -0700)]
doc/release-notes: note that radosgw's should be upgraded together

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1461 from ceph/wip-7692
Sage Weil [Fri, 14 Mar 2014 18:05:49 +0000 (11:05 -0700)]
Merge pull request #1461 from ceph/wip-7692

mon: on timecheck on monmap 0

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agoMerge pull request #1460 from ceph/wip-warning
Sage Weil [Fri, 14 Mar 2014 18:03:49 +0000 (11:03 -0700)]
Merge pull request #1460 from ceph/wip-warning

PGLog: remove unused variable

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agomon: only do timecheck with known monmap 1461/head
Sage Weil [Fri, 14 Mar 2014 18:02:30 +0000 (11:02 -0700)]
mon: only do timecheck with known monmap

If we are still on monmap epoch 0, our mon ranks cannot yet be trusted
since there is not yet a shared source of truth from paxos.  If we do
timechecks, the code gets confused about the ranks in e.g. the
timecheck_waiting map.

Fixes: #7692
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoceph-mon: be a bit more verbose on error
Sage Weil [Fri, 14 Mar 2014 18:00:36 +0000 (11:00 -0700)]
ceph-mon: be a bit more verbose on error

Motivated by #7489

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoPG::activate: handle peer contigious with primary, but not auth_log 1459/head
Samuel Just [Fri, 14 Mar 2014 01:16:19 +0000 (18:16 -0700)]
PG::activate: handle peer contigious with primary, but not auth_log

The added case covers a situation where a replica is not contiguous with
the auth_log, but is contiguous with the primary.  Reshuffling the
active set to handle this would be tricky, so instead we just go ahead
and backfill it anyway.  This is probably preferrable in any case since
the replica in question would have to be significantly behind.

Fixes: #7696
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1458 from ceph/wip-7489
Sage Weil [Fri, 14 Mar 2014 17:51:32 +0000 (10:51 -0700)]
Merge pull request #1458 from ceph/wip-7489

ceph_mon: split postfork() in two and finish postfork just before daemonize

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoceph_mon: output error message if unable to bind. 1458/head
Joao Eduardo Luis [Fri, 14 Mar 2014 17:45:57 +0000 (17:45 +0000)]
ceph_mon: output error message if unable to bind.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agoceph_mon: all output after initial fork go to dout/derr
Joao Eduardo Luis [Fri, 14 Mar 2014 17:44:06 +0000 (17:44 +0000)]
ceph_mon: all output after initial fork go to dout/derr

We were doing it in some cases, and not doing in some other cases.  Just
do it throughout.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agoceph_mon: split postfork() in two and finish postfork just before daemonize
Joao Eduardo Luis [Fri, 14 Mar 2014 17:39:00 +0000 (17:39 +0000)]
ceph_mon: split postfork() in two and finish postfork just before daemonize

We split global_init_postfork() in two: start and finish, with the first
keeping much of postfork()'s tasks except closing stderr, which we leave
open until just before we daemonize.  This allows the user to see any
error messages that the monitor may spit out before it daemonizes, making
sense of the error code (which we were already returning).

Fixes: 7489
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
11 years agoMerge remote-tracking branch 'gh/firefly'
Sage Weil [Fri, 14 Mar 2014 15:30:04 +0000 (08:30 -0700)]
Merge remote-tracking branch 'gh/firefly'

11 years agodoc/release-notes: 0.78 draft nodes; firefly draft notes
Sage Weil [Fri, 14 Mar 2014 15:29:18 +0000 (08:29 -0700)]
doc/release-notes: 0.78 draft nodes; firefly draft notes

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd/ReplicatedPG: release op locks on on commit+applied 1454/head
Sage Weil [Fri, 14 Mar 2014 05:02:01 +0000 (22:02 -0700)]
osd/ReplicatedPG: release op locks on on commit+applied

We were releasing the op locks when we applied the update but (potentially)
before we committed it.  This means that another client can read object
state that is not yet durable.

Fixes: #7709
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1450 from ceph/wip-7641
Loic Dachary [Fri, 14 Mar 2014 01:14:27 +0000 (02:14 +0100)]
Merge pull request #1450 from ceph/wip-7641

debian: make ceph depend on ceph-common >= 0.67

Reviewed-by: Loic Dachary <loic@dachary.org>
11 years agoqa/workunits: misc -> fs/misc
Sage Weil [Fri, 14 Mar 2014 00:38:08 +0000 (17:38 -0700)]
qa/workunits: misc -> fs/misc

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoPGLog: remove unused variable 1460/head
Samuel Just [Thu, 13 Mar 2014 23:44:32 +0000 (16:44 -0700)]
PGLog: remove unused variable

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1442 from ceph/wip-magic-bad
Sage Weil [Thu, 13 Mar 2014 23:43:11 +0000 (16:43 -0700)]
Merge pull request #1442 from ceph/wip-magic-bad

osd: tunables instead of hard-coded target dirty/full ratios

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoosd: add tunables for cache_min_{flush,evict}_age 1442/head
Sage Weil [Mon, 10 Mar 2014 20:54:34 +0000 (13:54 -0700)]
osd: add tunables for cache_min_{flush,evict}_age

Why not.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: set default cache_target_{dirty,full}_ratios based on configurable
Sage Weil [Mon, 10 Mar 2014 20:52:54 +0000 (13:52 -0700)]
osd: set default cache_target_{dirty,full}_ratios based on configurable

These were hard-coded in the pg_pool_t constructor, but that was a dumb
idea.

Note that decoding legacy pg_pool_t's no longer does what it used to.  I'm
pretty sure that's okay since we care less about interim releases and
because we are pulling these normally out of OSDMap, which is freshly
encoded on a regular basis (and certainly recently with real values). Also,
let's not forget that this field is meaningless on old pools anyway.

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1452 from ceph/wip-7706
Samuel Just [Thu, 13 Mar 2014 23:24:19 +0000 (16:24 -0700)]
Merge pull request #1452 from ceph/wip-7706

Wip 7706

Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1447 from ceph/wip-7703
Josh Durgin [Thu, 13 Mar 2014 22:53:06 +0000 (15:53 -0700)]
Merge pull request #1447 from ceph/wip-7703

rgw: manifest hold the actual bucket used for tail objects
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agomds: fix empty fs rstat
Sage Weil [Thu, 13 Mar 2014 22:17:55 +0000 (15:17 -0700)]
mds: fix empty fs rstat

In 81bcf43080a7be8a48aa13b88287cbfac0e01e3e we removed the .ceph directory
but did not adjust the rsubdirs back to 0.

Fixes: #7565
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge remote-tracking branch 'gh/firefly'
Sage Weil [Thu, 13 Mar 2014 22:15:49 +0000 (15:15 -0700)]
Merge remote-tracking branch 'gh/firefly'

11 years agoMerge pull request #1449 from ceph/wip-7705
Sage Weil [Thu, 13 Mar 2014 21:52:19 +0000 (14:52 -0700)]
Merge pull request #1449 from ceph/wip-7705

ceph_test_rados: wait for commit not ack

Reviewed-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoceph_test_rados: wait for commit, not ack 1448/head 1449/head
Sage Weil [Thu, 13 Mar 2014 21:49:30 +0000 (14:49 -0700)]
ceph_test_rados: wait for commit, not ack

First, this is what we wanted in the first place

Second, if we wait for ACK, we may look at a user_version value that is
not stable.

Fixes: #7705
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMOSDOp: include reassert_version in print
Sage Weil [Thu, 13 Mar 2014 21:45:49 +0000 (14:45 -0700)]
MOSDOp: include reassert_version in print

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoconfig_opts: raise ms_pq_max_tokens_per_priority to 16MB 1451/head 1452/head
Samuel Just [Thu, 13 Mar 2014 21:07:19 +0000 (14:07 -0700)]
config_opts: raise ms_pq_max_tokens_per_priority to 16MB

Recovery messages can get pretty big.

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoPrioritizedQueue: cap costs at max_tokens_per_subqueue
Samuel Just [Thu, 13 Mar 2014 21:04:19 +0000 (14:04 -0700)]
PrioritizedQueue: cap costs at max_tokens_per_subqueue

Otherwise, you can get a recovery op in the queue which has a cost
higher than the max token value.  It won't get serviced until all other
queues also do not have enough tokens and higher priority queues are
empty.

Fixes: #7706
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agorgw: manifest hold the actual bucket used for tail objects 1446/head 1447/head
Yehuda Sadeh [Thu, 13 Mar 2014 18:25:24 +0000 (11:25 -0700)]
rgw: manifest hold the actual bucket used for tail objects

Fixes: 7703
Object can be copied between different buckets, so we need to keep track
of which bucket is used for naming the tail parts. The new manifest
requires that because older manifest just held all the tail objects
(each containing the appropriate bucket internally).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agorbd-fuse: fix signed/unsigned warning
Sage Weil [Thu, 13 Mar 2014 18:22:34 +0000 (11:22 -0700)]
rbd-fuse: fix signed/unsigned warning

rbd_fuse/rbd-fuse.c: In function 'enumerate_images':
rbd_fuse/rbd-fuse.c:113:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agomds/Mutation.h: init export_dir with NULL in ctor 1445/head
Danny Al-Gaaf [Thu, 13 Mar 2014 17:48:00 +0000 (18:48 +0100)]
mds/Mutation.h: init export_dir with NULL in ctor

CID 1188167 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 2. uninit_member: Non-static class member "export_dir" is not initialized in
 this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomds/Migrator.h: init some members of import_state_t in ctor
Danny Al-Gaaf [Thu, 13 Mar 2014 17:39:32 +0000 (18:39 +0100)]
mds/Migrator.h: init some members of import_state_t in ctor

CID 1188166 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 2. uninit_member: Non-static class member "state" is not initialized in this
   constructor nor in any functions that it calls.
 4. uninit_member: Non-static class member "peer" is not initialized in this
   constructor nor in any functions that it calls.
 6. uninit_member: Non-static class member "tid" is not initialized in this
   constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomds/Migrator.h: init some export_state_t members in ctor
Danny Al-Gaaf [Thu, 13 Mar 2014 17:30:54 +0000 (18:30 +0100)]
mds/Migrator.h: init some export_state_t members in ctor

CID 1188165 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 2. uninit_member: Non-static class member "state" is not initialized in
  this constructor nor in any functions that it calls.
 4. uninit_member: Non-static class member "peer" is not initialized in this
  constructor nor in any functions that it calls.
 6. uninit_member: Non-static class member "tid" is not initialized in this
  constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoCInode::encode_cap_message: add assert for cap
Danny Al-Gaaf [Thu, 13 Mar 2014 16:59:41 +0000 (17:59 +0100)]
CInode::encode_cap_message: add assert for cap

CID 716913 (#1 of 1): Dereference after null check (FORWARD_NULL)
5. var_deref_op: Dereferencing null pointer "cap".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_filejournal.cc: use strncpy and terminate with '\0'
Danny Al-Gaaf [Thu, 13 Mar 2014 16:21:53 +0000 (17:21 +0100)]
test_filejournal.cc: use strncpy and terminate with '\0'

CID 966632 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
 2. fixed_size_dest: You might overrun the 200 byte fixed-size string
 "path" by copying "args[0UL]" without checking the length.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1433 from fractalcat/fix-crypto-init-race-condition
Sage Weil [Thu, 13 Mar 2014 15:44:16 +0000 (08:44 -0700)]
Merge pull request #1433 from fractalcat/fix-crypto-init-race-condition

Work around race condition in libnss

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1443 from fghaas/doc-fix
Sage Weil [Thu, 13 Mar 2014 15:40:41 +0000 (08:40 -0700)]
Merge pull request #1443 from fghaas/doc-fix

doc: fix formatting on PG recommendation

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoAdd unit test for race condition in libnss 1433/head
Sharif Olorin [Thu, 13 Mar 2014 07:36:00 +0000 (18:36 +1100)]
Add unit test for race condition in libnss

This isn't in test/crypto.cc because common_init_finish is called prior
to running any tests. Will not build the test function if Ceph hasn't
been configured with NSS.

Signed-off-by: Sharif Olorin <sio@tesser.org>
11 years agoWork around race condition in libnss
Sharif Olorin [Wed, 12 Mar 2014 08:01:00 +0000 (19:01 +1100)]
Work around race condition in libnss

This change prevents a segfault in ceph::crypto::init when using NSS and
calling rados_connect from multiple threads simultaneously on different
rados_t objects (and updates the documentation for rados_connect to
reflect the fix).

It's pretty simple, just one static mutex wrapping the
NSS definition of ceph::crypto::init. More details regarding the race
condition are in this[0] commit (and pull request #1424).

To reproduce the race condition in the existing codebase, the below[1]
C program will work (depending on number of cores and probably other
things, the number of threads needed to reliably reproduce varies, but
the more the better - in my environment five is sufficient, with four
cores.

[0]: 377c919088423bafcae92759f8d578438717705c

[1]:

```c

void *init(void *p) {
int err;
rados_t cluster;
err = rados_create(&cluster, NULL);
if (err < 0) {
fprintf(stderr, "cannot create cluster handle: %s\n", strerror(-err));
return NULL;
}
err = rados_conf_read_file(cluster, "./ceph.conf");
if (err < 0) {
fprintf(stderr, "error reading config file: %s\n", strerror(-err));
return NULL;
}
rados_connect(cluster);
return NULL;
}

int main() {
pthread_t ts[NTHREAD];
int i;
for (i = 0; i < NTHREAD; i++) {
pthread_create(&ts[i], NULL, init, NULL);
}
for (i = 0; i < NTHREAD; i++) {
int k;
void *p = (void*)&k;
pthread_join(ts[i], p);
}

return 0;
}
```

Signed-off-by: Sharif Olorin <sio@tesser.org>
11 years agodoc: fix formatting on PG recommendation 1443/head
Florian Haas [Thu, 13 Mar 2014 10:32:05 +0000 (11:32 +0100)]
doc: fix formatting on PG recommendation

Previous commit (047287afbe0ddfaaafd05e9dbf25c1c7dea9a1be) broke
formatting on the formula, and also made mixed formula and text oddly,
which on second thought didn't look too good.

Add the note about the power of two to the following paragraph
instead, in prose.

Signed-off-by: Florian Haas <florian@hastexo.com>
11 years agolibcephfs/test.cc: shutdown cmount at end of MountNonExist
Danny Al-Gaaf [Thu, 13 Mar 2014 10:21:42 +0000 (11:21 +0100)]
libcephfs/test.cc: shutdown cmount at end of MountNonExist

CID 966624 (#5 of 5): Resource leak (RESOURCE_LEAK)
 17. leaked_storage: Variable "cmount" going out of scope leaks the
 storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agolibcephfs/test.cc: shutdown cmount
Danny Al-Gaaf [Thu, 13 Mar 2014 08:48:44 +0000 (09:48 +0100)]
libcephfs/test.cc: shutdown cmount

CID 743410 (#17 of 17): Resource leak (RESOURCE_LEAK)
 65. leaked_storage: Variable "cmount" going out of scope leaks the storage
 it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_librbd.cc: add missing va_end() to test_ls_pp
Danny Al-Gaaf [Thu, 13 Mar 2014 08:03:57 +0000 (09:03 +0100)]
test_librbd.cc: add missing va_end() to test_ls_pp

CID 1054877 (#1 of 1): Missing varargs init or cleanup (VARARGS)
 17. missing_va_end: va_end was not called for "ap".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomailmap: Danny Al-Gaaf name normalization
Danny Al-Gaaf [Thu, 13 Mar 2014 06:49:53 +0000 (07:49 +0100)]
mailmap: Danny Al-Gaaf name normalization

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agodoc/release-notes: note that WATCH can get ENOENT now
Sage Weil [Thu, 13 Mar 2014 04:32:21 +0000 (21:32 -0700)]
doc/release-notes: note that WATCH can get ENOENT now

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1440 from ceph/wip-7649
Samuel Just [Thu, 13 Mar 2014 01:33:03 +0000 (18:33 -0700)]
Merge pull request #1440 from ceph/wip-7649

Wip 7649

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1441 from ceph/wip-7671
Sage Weil [Thu, 13 Mar 2014 00:09:31 +0000 (17:09 -0700)]
Merge pull request #1441 from ceph/wip-7671

Wip 7671

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agotest/librados/watch_notify: create foo before watching 1441/head
Samuel Just [Tue, 11 Mar 2014 21:17:47 +0000 (14:17 -0700)]
test/librados/watch_notify: create foo before watching

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agotest/system/st_rados_watch: expect ENOENT for watch on non-existent object
Samuel Just [Tue, 11 Mar 2014 18:25:47 +0000 (11:25 -0700)]
test/system/st_rados_watch: expect ENOENT for watch on non-existent object

Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1439 from ceph/wip-7682
Sage Weil [Wed, 12 Mar 2014 22:45:35 +0000 (15:45 -0700)]
Merge pull request #1439 from ceph/wip-7682

ReplicatedPG::already_(complete|ack) should skip temp object ops

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoRGWListBucketMultiparts: init max_uploads/default_max with 0
Danny Al-Gaaf [Wed, 12 Mar 2014 21:56:44 +0000 (22:56 +0100)]
RGWListBucketMultiparts: init max_uploads/default_max with 0

CID 717377 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 2. uninit_member: Non-static class member "max_uploads" is not initialized
    in this constructor nor in any functions that it calls.
 4. uninit_member: Non-static class member "default_max" is not initialized
    in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoAbstractWrite: initialize m_snap_seq with 0
Danny Al-Gaaf [Wed, 12 Mar 2014 21:37:12 +0000 (22:37 +0100)]
AbstractWrite: initialize m_snap_seq with 0

CID 717223 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 2. uninit_member: Non-static class member "m_snap_seq" is not initialized
 in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoReplicatedPG::already_(complete|ack) should skip temp object ops 1439/head
Samuel Just [Wed, 12 Mar 2014 21:07:50 +0000 (14:07 -0700)]
ReplicatedPG::already_(complete|ack) should skip temp object ops

We clearly won't get dup ops on these repops, and they don't
have meaningful versions since they don't carry log
entries.

Fixes: #7682
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoAdminSocket: initialize m_getdescs_hook in the constructor
Danny Al-Gaaf [Wed, 12 Mar 2014 20:03:25 +0000 (21:03 +0100)]
AdminSocket: initialize m_getdescs_hook in the constructor

CID 717212 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 2. uninit_member: Non-static class member "m_getdescs_hook" is not
 initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoRGWPutCORS_ObjStore_S3::get_params: check data before dereference
Danny Al-Gaaf [Wed, 12 Mar 2014 19:27:57 +0000 (20:27 +0100)]
RGWPutCORS_ObjStore_S3::get_params: check data before dereference

CID 1063697 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
 5. var_deref_model: Passing null pointer "data" to function
 "RGWXMLParser::parse(char const *, int, int)", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomds/Server.cc: check straydn before dereference
Danny Al-Gaaf [Wed, 12 Mar 2014 19:09:22 +0000 (20:09 +0100)]
mds/Server.cc: check straydn before dereference

ID 1019554 (#1 of 1): Dereference after null check (FORWARD_NULL)
 13. var_deref_model: Passing null pointer "straydn" to function
 "MDSCacheObject::is_auth() const", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1423 from fractalcat/respect-python-env
Sage Weil [Wed, 12 Mar 2014 19:05:05 +0000 (12:05 -0700)]
Merge pull request #1423 from fractalcat/respect-python-env

Update Python hashbang to respect environment

11 years agoMerge pull request #1434 from ceph/wip-7695
Sage Weil [Wed, 12 Mar 2014 18:57:46 +0000 (11:57 -0700)]
Merge pull request #1434 from ceph/wip-7695

build-doc: fix checks for required commands for non-debian

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1438 from fghaas/doc-fix
Sage Weil [Wed, 12 Mar 2014 18:55:13 +0000 (11:55 -0700)]
Merge pull request #1438 from fghaas/doc-fix

doc: Add "nearest power of two" to PG rule-of-thumb

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agodoc: Add "nearest power of two" to PG rule-of-thumb 1438/head
Florian Haas [Wed, 12 Mar 2014 18:31:54 +0000 (19:31 +0100)]
doc: Add "nearest power of two" to PG rule-of-thumb

Following an IRC discussion, it emerged that it would be helpful
to explain the merit of choosing a number of PGs per pool that is
a power of two, to keep PGs at roughly equal sizes in case of
PG splits.

See http://irclogs.ceph.widodh.nl/index.php?date=2014-03-12 for the
original discussion.

Signed-off-by: Florian Haas <florian@hastexo.com>
11 years agoOSDMonitor::prepare_pool_op: add missing break in case
Danny Al-Gaaf [Wed, 12 Mar 2014 18:09:38 +0000 (19:09 +0100)]
OSDMonitor::prepare_pool_op: add missing break in case

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

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1436 from ceph/wip-7681
Sage Weil [Wed, 12 Mar 2014 17:46:54 +0000 (10:46 -0700)]
Merge pull request #1436 from ceph/wip-7681

ECBackend: when removing the temp obj, use the right shard

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1437 from ceph/wip-7650
Sage Weil [Wed, 12 Mar 2014 17:44:50 +0000 (10:44 -0700)]
Merge pull request #1437 from ceph/wip-7650

tools/rados/rados.cc: use write_full for sync_write for ec pools

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoPG: do not wait for flushed before activation 1440/head
Samuel Just [Tue, 11 Mar 2014 21:23:10 +0000 (14:23 -0700)]
PG: do not wait for flushed before activation

This should reduce the sting of the previous commit somewhat.  We wait
for the activation transactions to clear prior to accepting IO anyway,
so we can go ahead and get that process started without waiting for the
flush.

Signed-off-by: Samuel Just <sam.just@inktank.com>