]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
9 years agoMerge pull request #5699 from dachary/wip-11881-multipath
Sage Weil [Mon, 31 Aug 2015 15:06:27 +0000 (11:06 -0400)]
Merge pull request #5699 from dachary/wip-11881-multipath

  ceph-disk: add multipath support

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoceph-disk: integration tests for multipath 5699/head
Loic Dachary [Thu, 27 Aug 2015 20:22:43 +0000 (22:22 +0200)]
ceph-disk: integration tests for multipath

Add integration tests for multipath to the ceph-disk workunit, with the
following caveats:

A workaround is added (explicit call to ceph-disk activate) until the
CentOS activation bug http://tracker.ceph.com/issues/12786 is fixed.

The tests do not run on Ubuntu because of the multipath / device mapper
bug
https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/1488688
and it has not been tested on Debian.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: implement workunit
Loic Dachary [Thu, 27 Aug 2015 20:17:21 +0000 (22:17 +0200)]
ceph-disk: implement workunit

This new ceph-disk workunit re-implements the tests that previously were
in the src/test/ceph-disk.sh src/test/ceph-disk-root.sh scripts and is
meant to run in a virtual machine instead of docker.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agotests: remove dead scripts
Loic Dachary [Thu, 27 Aug 2015 20:12:01 +0000 (22:12 +0200)]
tests: remove dead scripts

Revert 2d0d388162fba25af828ad2cb16560a6d00f2337 which introduced scripts
that were never actually used.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: CentOS 7 is systemd
Loic Dachary [Thu, 27 Aug 2015 20:08:46 +0000 (22:08 +0200)]
ceph-disk: CentOS 7 is systemd

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

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: implement list --format json
Loic Dachary [Thu, 27 Aug 2015 11:14:13 +0000 (13:14 +0200)]
ceph-disk: implement list --format json

The ceph-disk list command is reworked in two parts:

 1) the list_devices function that build an internal structure with all
    the information regarding disks and partitions.
 2) a function to display the internal structure in plain text or json

The ceph-disk list show the plain text version and is backward
compatible.

The ceph-disk list --format json output has more information about each
device than the plain text version and is intended for scripts.

The unit tests cover all modified lines (2610 to 2849).

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: fix dmcrypt typo
Loic Dachary [Thu, 27 Aug 2015 10:51:14 +0000 (12:51 +0200)]
ceph-disk: fix dmcrypt typo

Fix the typo introduced by 29431944c77adbc3464a8faeb7e052b24f821780

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: cosmetic: setup_logging function
Loic Dachary [Thu, 27 Aug 2015 10:43:58 +0000 (12:43 +0200)]
ceph-disk: cosmetic: setup_logging function

Split the main function to extract the verbose handling part into the
setup_logging function.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: cosmetic: argparse functions
Loic Dachary [Thu, 27 Aug 2015 10:41:41 +0000 (12:41 +0200)]
ceph-disk: cosmetic: argparse functions

Split the large parse_args function into separate functions, one for
each subparser.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: use sys.argv instead of implicit
Loic Dachary [Thu, 27 Aug 2015 10:37:15 +0000 (12:37 +0200)]
ceph-disk: use sys.argv instead of implicit

Make parse_args and main use and argument instead of relying on
argparse.ArgumentParser implicit use of sys.argv. It helps with tests.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agotests: obsolete ceph-disk root tests
Loic Dachary [Thu, 27 Aug 2015 10:21:48 +0000 (12:21 +0200)]
tests: obsolete ceph-disk root tests

They were designed to run in a docker container using loop devices
instead of disks. Although this was fit for ceph-disk activate tests for
regular and dmcrypt devices, a docker instance does not have its own
udev instance it is not possible to run tests involving udev events
without interfering with the host.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: add multipath support
Loic Dachary [Sun, 16 Aug 2015 00:37:01 +0000 (02:37 +0200)]
ceph-disk: add multipath support

A multipath device is detected because there is a
/sys/dev/block/M:m/dm/uuid file with the mpath- prefix (or part\w+-mpath
prefix).

When ceph-disk prepares data or journal devices on a multipath device,
it sets the partition typecode to MPATH_JOURNAL_UUID, MPATH_OSD_UUID and
MPATH_TOBE_UUID to

 a) help the udev rules distinguish them from other devices in
    devicemapper
 b) allow ceph-disk to fail if an attempt is made to activate a device
    with this type without accessing it via a multipath device

The 95-ceph-osd.rules call ceph-disk activate on partitions of type
MPATH_JOURNAL_UUID, MPATH_OSD_UUID. It relies on ceph-disk to do nothing
if the device is not accessed via multipath.

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

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: is_held must ignore multipath devices
Loic Dachary [Mon, 17 Aug 2015 22:18:51 +0000 (00:18 +0200)]
ceph-disk: is_held must ignore multipath devices

Always return an empty list when is_held is called on a multipath
device.

The dmcrypt logic base decisions depending on the holders/slaves
relationship. Such relationships can also exists for multipath devices
but do not have the same semantic.

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

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: rework get_partition_{type,uuid}
Loic Dachary [Mon, 17 Aug 2015 22:04:32 +0000 (00:04 +0200)]
ceph-disk: rework get_partition_{type,uuid}

Mimic the get_partition_type implementation after get_partition_uuid
and factorize them to reduce the code footprint.

The get_partition_type implementation is based on blkid: it is complex
and fragile. Since sgdisk is consistently used to create partitions, use
it instead. It is already used for get_partition_uuid and there does not
seem to be any reason for concern.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: multipath support for split_dev_base_partnum
Loic Dachary [Mon, 17 Aug 2015 21:51:24 +0000 (23:51 +0200)]
ceph-disk: multipath support for split_dev_base_partnum

split_dev_base_partnum returns the path of the whole disk in
/dev/mapper. The base variable name to designate the device for the
whole disk is a misnomer since it cannot be used as a basename to
rebuild the parition device name in the case of multipath.

The logic of split_dev_base_partnum for devices is reworked to use
/sys/dev/block/M:m/partition instead of device name parsing.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: multipath support for is_partition and list_partitions
Loic Dachary [Mon, 17 Aug 2015 21:25:45 +0000 (23:25 +0200)]
ceph-disk: multipath support for is_partition and list_partitions

The is_partition predicate and the list_partitions function support
devices managed by multipath.

A set of helpers dedicated to multipath devices is implemented because
the content of the corresponding /sys directory does not use the same
conventions as regular devices regarding partitions.

Instead of relying on subdirectories such as /sys/block/name/name1, the
devicemapper uuid file is used and expected to start with part\d+. The
holders/slaves directories provide pointers between the whole device and
the partition devices.

Although these structural differences reduce the opportunity for
code factorization, it is easier for backward compatibility since the
multipath specific logic is limited to if is_mpath(dev) branches.

http://tracker.ceph.com/issues/11881 Refs: #11881

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: --verbose shows a stack trace on error
Loic Dachary [Mon, 17 Aug 2015 21:02:40 +0000 (23:02 +0200)]
ceph-disk: --verbose shows a stack trace on error

When running with --verbose, do not hide the stack trace from the user
when an exception is raised. It is most helpful to figure out when the
exception actually happened.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: replace partx with partprobe
Loic Dachary [Mon, 17 Aug 2015 21:00:44 +0000 (23:00 +0200)]
ceph-disk: replace partx with partprobe

Older distributions that required partx (CentOS 6 and the like) are no
longer supported and the partx fallback can be obsoleted.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoceph-disk: is_mpath predicate for multipath devices
Loic Dachary [Mon, 17 Aug 2015 20:52:25 +0000 (22:52 +0200)]
ceph-disk: is_mpath predicate for multipath devices

The is_mpath predicate returns True if a device is managed by
multipath. It is based on the devicemapper uuid content which is
expected to always contain the mpath- string to identify the multipath
subsystem.

The block_path helper is added to convert the path to a device to the
/sys directory that describes it. It uses the major and minor number
instead of the device name because it is more reliable. The rationale
including an actual example is added as a comment for future
maintainers.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agotests: ceph-disk tests may use system ceph-{mon,osd}
Loic Dachary [Mon, 17 Aug 2015 20:22:12 +0000 (22:22 +0200)]
tests: ceph-disk tests may use system ceph-{mon,osd}

Allow ceph-disk.sh to run to test ceph as installed from packages.

When run from sources, ceph-disk.sh is expected to use the binaries from
the source tree. It is enough to prepend . to the PATH. There is no need
to prefix each binary with ./

The virtualenv is also only necessary when running from sources and
setting it up for ceph-detect-init is only done if in the source tree.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoudev: add devicemapper to partuuid-workaround
Loic Dachary [Sun, 16 Aug 2015 10:05:51 +0000 (12:05 +0200)]
udev: add devicemapper to partuuid-workaround

The dm-* devices are not excluded and will have by-partuuid symlinks
etc. This will include devices managed by multipath as well as
others. Since this only is used on partitions:

  # ignore partitions that span the entire disk
  TEST=="whole_disk", GOTO="persistent_storage_end_two"

It may create symlinks for dm-* devices that are unrelated to Ceph and
we assume this is going to be ok.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
9 years agoMerge remote-tracking branch 'gh/infernalis'
Sage Weil [Fri, 28 Aug 2015 19:20:04 +0000 (15:20 -0400)]
Merge remote-tracking branch 'gh/infernalis'

9 years agoMerge pull request #5690 from dzafman/wip-pgls-zafman
Sage Weil [Fri, 28 Aug 2015 17:19:23 +0000 (13:19 -0400)]
Merge pull request #5690 from dzafman/wip-pgls-zafman

cls: Fix successful return found by compiler warning

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5704 from tchaikov/wip-adventure-mode
Sage Weil [Fri, 28 Aug 2015 16:20:18 +0000 (12:20 -0400)]
Merge pull request #5704 from tchaikov/wip-adventure-mode

common: 'enable experimental data corrupting features' now understand '*'

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5667 from liewegas/wip-9221
Samuel Just [Fri, 28 Aug 2015 16:18:16 +0000 (09:18 -0700)]
Merge pull request #5667 from liewegas/wip-9221

ceph_test_rados_api_tier: make PromoteOn2ndRead tolerate thrashing

Reviewed-by: Samuel Just <sjust@redhat.com>
9 years agoMerge pull request #5666 from liewegas/wip-12785
Samuel Just [Fri, 28 Aug 2015 16:17:54 +0000 (09:17 -0700)]
Merge pull request #5666 from liewegas/wip-12785

osd: fix off-by-one in hobject_t::is_temp()  (bug 12785)

Reviewed-by: Samuel Just <sjust@redhat.com>
9 years agocommon: 'enable experimental data corrupting features' now understands '*' 5704/head
Kefu Chai [Fri, 28 Aug 2015 16:08:10 +0000 (00:08 +0800)]
common: 'enable experimental data corrupting features' now understands '*'

'*' allows any feature.

Signed-off-by: Kefu Chai <kchai@redhat.com>
9 years agoMerge pull request #5609 from rohanmars/wip-timegm
Sage Weil [Fri, 28 Aug 2015 16:14:41 +0000 (12:14 -0400)]
Merge pull request #5609 from rohanmars/wip-timegm

added boost timegm impl for cross platform support

In the future it would be nice to avoid duplication of the code in each compiled module, but this works for now.  The only real user right now is rgw.

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5627 from wonzhq/agent-work
Sage Weil [Fri, 28 Aug 2015 16:13:57 +0000 (12:13 -0400)]
Merge pull request #5627 from wonzhq/agent-work

osd: do evict before flush in agent_work

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5640 from liewegas/wip-mutex-lock
Sage Weil [Fri, 28 Aug 2015 16:13:38 +0000 (12:13 -0400)]
Merge pull request #5640 from liewegas/wip-mutex-lock

mutex: avoid trylock unless instrumentation is enabled

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
9 years agoMerge pull request #5656 from XinzeChi/wip-buffer-emtpyptr
Sage Weil [Fri, 28 Aug 2015 16:12:45 +0000 (12:12 -0400)]
Merge pull request #5656 from XinzeChi/wip-buffer-emtpyptr

common: fix insert empty ptr when bufferlist rebuild

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5453 from wonzhq/recover-primary
Kefu Chai [Fri, 28 Aug 2015 15:45:25 +0000 (23:45 +0800)]
Merge pull request #5453 from wonzhq/recover-primary

osd: recovery fixes

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5415 from wonzhq/do-recovery
Kefu Chai [Fri, 28 Aug 2015 15:40:41 +0000 (23:40 +0800)]
Merge pull request #5415 from wonzhq/do-recovery

osd: do_recovery cleanup

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
9 years agoMerge pull request #5703 from ceph/wip-boost-random-cmake
Sage Weil [Fri, 28 Aug 2015 15:14:31 +0000 (11:14 -0400)]
Merge pull request #5703 from ceph/wip-boost-random-cmake

CMake: update for boost_random

9 years agoCMake: update for boost_random 5703/head
John Spray [Fri, 28 Aug 2015 14:33:12 +0000 (15:33 +0100)]
CMake: update for boost_random

This became a dependency in dbcaa544

Signed-off-by: John Spray <john.spray@redhat.com>
9 years agoMerge pull request #5701 from guce/h3c_mail_organization_map
Loic Dachary [Fri, 28 Aug 2015 10:23:19 +0000 (12:23 +0200)]
Merge pull request #5701 from guce/h3c_mail_organization_map

h3c mail organization map

Reviewed-by: Loic Dachary <ldachary@redhat.com>
9 years agoh3c mail organization map 5701/head
guce [Fri, 28 Aug 2015 09:56:19 +0000 (17:56 +0800)]
h3c mail organization map

update .mailmap and .organizationmap for h3c organization

Signed-off-by: Ce Gu <guce@h3c.com>
9 years agoMerge pull request #5114 from branch-predictor/bp-reduced-memzero
Kefu Chai [Fri, 28 Aug 2015 02:08:56 +0000 (10:08 +0800)]
Merge pull request #5114 from branch-predictor/bp-reduced-memzero

ObjectStore/FileJournal: reduce impact of memset()

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agocls: Fix successful return found by compiler warning 5690/head
David Zafman [Thu, 27 Aug 2015 23:21:50 +0000 (16:21 -0700)]
cls: Fix successful return found by compiler warning

Signed-off-by: David Zafman <dzafman@redhat.com>
9 years agoMerge pull request #5688 from dzafman/wip-decode-zafman
David Zafman [Thu, 27 Aug 2015 19:58:47 +0000 (12:58 -0700)]
Merge pull request #5688 from dzafman/wip-decode-zafman

osd: Decode use_gmt_hitset with a unique version

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5679 from wonzhq/store-test
Samuel Just [Thu, 27 Aug 2015 18:59:49 +0000 (11:59 -0700)]
Merge pull request #5679 from wonzhq/store-test

test: disable newstore test until it's merged

Reviewed-by: Samuel Just <sjust@redhat.com>
9 years agoosd: Decode use_gmt_hitset with a unique version 5688/head
David Zafman [Thu, 27 Aug 2015 18:24:25 +0000 (11:24 -0700)]
osd: Decode use_gmt_hitset with a unique version

Signed-off-by: David Zafman <dzafman@redhat.com>
9 years agoMerge pull request #5545 from ceph/wip-objclass-filters
John Spray [Thu, 27 Aug 2015 17:14:37 +0000 (18:14 +0100)]
Merge pull request #5545 from ceph/wip-objclass-filters

Allow object classes to define PGLS filters

Reviewed-by: David Zafman <dzafman@redhat.com>
9 years agoMerge remote-tracking branch 'gh/wip-osd-compat'
Sage Weil [Thu, 27 Aug 2015 17:05:40 +0000 (13:05 -0400)]
Merge remote-tracking branch 'gh/wip-osd-compat'

Reviewed-by: Samuel Just <sjust@redhat.com>
9 years agoMerge pull request #5683 from tchaikov/wip-hitset-gmt-yet-another-feature-bit
Sage Weil [Thu, 27 Aug 2015 16:41:54 +0000 (12:41 -0400)]
Merge pull request #5683 from tchaikov/wip-hitset-gmt-yet-another-feature-bit

osd: do not let OSD_HITSET_GMT reuse the feature bit

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoosd: do not let OSD_HITSET_GMT reuse the feature bit 5683/head
Kefu Chai [Thu, 27 Aug 2015 16:32:38 +0000 (00:32 +0800)]
osd: do not let OSD_HITSET_GMT reuse the feature bit

* to ease the backport to hammer

Signed-off-by: Kefu Chai <kchai@redhat.com>
9 years agoMerge pull request #5524 from tchaikov/wip-monstore-cache
Joao Eduardo Luis [Thu, 27 Aug 2015 15:21:16 +0000 (16:21 +0100)]
Merge pull request #5524 from tchaikov/wip-monstore-cache

mon: add a cache layer over MonitorDBStore

Reviewed-by: Joao Eduardo Luis <joao@suse.de>
Reviewed-by: Sage Weil <sage@redhat.com>
9 years agoMerge pull request #5669 from yuyuyu101/wip-12745
Sage Weil [Thu, 27 Aug 2015 14:10:55 +0000 (10:10 -0400)]
Merge pull request #5669 from yuyuyu101/wip-12745

ms/simple: Messenger/MessengerTest.SyntheticInjectTest2/1 hang

Reviewed-by: Sage Weil <sage@redhat.com>
9 years agodoc/release-notes: v0.94.3
Sage Weil [Thu, 27 Aug 2015 14:06:07 +0000 (10:06 -0400)]
doc/release-notes: v0.94.3

Fix up the release timeline link for v9.0.3 too.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoosd: separate filter init from construction 5545/head
John Spray [Thu, 27 Aug 2015 13:12:59 +0000 (14:12 +0100)]
osd: separate filter init from construction

...so that implementations can readily handle
decode errors in client args and return an
error code.

Signed-off-by: John Spray <john.spray@redhat.com>
9 years agotest: add a test for filter in cls hello
John Spray [Tue, 11 Aug 2015 12:30:19 +0000 (13:30 +0100)]
test: add a test for filter in cls hello

Signed-off-by: John Spray <john.spray@redhat.com>
9 years agocls: add a filter to the hello class for testing
John Spray [Tue, 11 Aug 2015 12:17:22 +0000 (13:17 +0100)]
cls: add a filter to the hello class for testing

Signed-off-by: John Spray <john.spray@redhat.com>
9 years agoobjclass: enable unregistering filter factory
John Spray [Tue, 11 Aug 2015 14:56:59 +0000 (15:56 +0100)]
objclass: enable unregistering filter factory

Signed-off-by: John Spray <john.spray@redhat.com>
9 years agoAsyncConnection: Fix uninitialized variable compile warning 5669/head
Haomai Wang [Wed, 26 Aug 2015 02:49:32 +0000 (10:49 +0800)]
AsyncConnection: Fix uninitialized variable compile warning

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
9 years agoTestMsgr: Fix forever hang under lossless policy and one is WAIT another down
Haomai Wang [Wed, 26 Aug 2015 02:36:10 +0000 (10:36 +0800)]
TestMsgr: Fix forever hang under lossless policy and one is WAIT another down

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
9 years agoMerge pull request #5678 from ceph/wip-12208
Orit Wasserman [Thu, 27 Aug 2015 08:40:23 +0000 (10:40 +0200)]
Merge pull request #5678 from ceph/wip-12208

rgw: delete finisher only after finalizing watches

9 years agoMerge pull request #5677 from ceph/wip-11455
Orit Wasserman [Thu, 27 Aug 2015 08:39:47 +0000 (10:39 +0200)]
Merge pull request #5677 from ceph/wip-11455

rgw: init some manifest fields when handling explicit objs

9 years agoMerge pull request #5651 from theanalyst/rgw/fixiso8601
Orit Wasserman [Thu, 27 Aug 2015 08:38:36 +0000 (10:38 +0200)]
Merge pull request #5651 from theanalyst/rgw/fixiso8601

rgw: be more flexible with iso8601 timestamps

9 years agotest: don't unmount when no store is created 5679/head
Zhiqiang Wang [Thu, 27 Aug 2015 04:27:52 +0000 (12:27 +0800)]
test: don't unmount when no store is created

When store is not created in SetUp for some reasons, unmounting it would
lead to segment fault.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
9 years agotest: handle the case when ObjectStore::create returns NULL
Zhiqiang Wang [Thu, 27 Aug 2015 03:17:17 +0000 (11:17 +0800)]
test: handle the case when ObjectStore::create returns NULL

When the objectstore type doesn't exist, NULL is returned in SetUp.
Handle the NULL return code to avoid a segment fault.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
9 years agotest: disable newstore test until it's merged
Zhiqiang Wang [Thu, 27 Aug 2015 03:05:58 +0000 (11:05 +0800)]
test: disable newstore test until it's merged

Newstore hasn't been merged. It leads to a segment fault in one of the
teuthology testing job since ObjectStore::create() returns NULL.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
9 years agoMerge pull request #4456 from ceph/wip-user
Sage Weil [Thu, 27 Aug 2015 00:41:05 +0000 (20:41 -0400)]
Merge pull request #4456 from ceph/wip-user

run ceph daemons as user and group ceph

9 years agoMerge pull request #5674 from ceph/wip-selinux-post-script
Sage Weil [Thu, 27 Aug 2015 00:38:53 +0000 (20:38 -0400)]
Merge pull request #5674 from ceph/wip-selinux-post-script

ceph.spec.in: Restart services only if they are running

Reviewed-by: Milan Broz <mbroz@redhat.com>
9 years agodebian: /var/run/ceph should be owned by ceph:ceph 4456/head
Sage Weil [Tue, 25 Aug 2015 16:32:22 +0000 (12:32 -0400)]
debian: /var/run/ceph should be owned by ceph:ceph

Fix upstart and sysvinit scripts to create /var/run/ceph properly.

Chown existing dir on upgrade.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoupstart: setuser ceph
Sage Weil [Wed, 19 Aug 2015 23:20:38 +0000 (19:20 -0400)]
upstart: setuser ceph

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian/ceph-common.dirs: install /var/lib/ceph
Sage Weil [Wed, 19 Aug 2015 21:20:13 +0000 (17:20 -0400)]
debian/ceph-common.dirs: install /var/lib/ceph

It is the ceph user's home dir and we need to set the ownership.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian/ceph-common.postinst: fix adduser, addgroup
Sage Weil [Tue, 18 Aug 2015 18:50:42 +0000 (14:50 -0400)]
debian/ceph-common.postinst: fix adduser, addgroup

Drop the extra groups thing--it's broken anyway.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian/ceph-common.postinst: fix /var/log/ceph permissions
Sage Weil [Tue, 18 Aug 2015 17:46:34 +0000 (13:46 -0400)]
debian/ceph-common.postinst: fix /var/log/ceph permissions

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian: rename ceph-common.postinst
Sage Weil [Tue, 18 Aug 2015 13:12:51 +0000 (09:12 -0400)]
debian: rename ceph-common.postinst

There was a trailing space!

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoPendingReleaseNotes: more notes about the 'ceph' user
Sage Weil [Wed, 12 Aug 2015 20:54:55 +0000 (16:54 -0400)]
PendingReleaseNotes: more notes about the 'ceph' user

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoglobal_init: ignore --set{user,group} if not root
Sage Weil [Wed, 12 Aug 2015 20:50:31 +0000 (16:50 -0400)]
global_init: ignore --set{user,group} if not root

Assume these options can only drop privileges; normal users can't setuid
root (and even if they could we wouldn't want to).

This makes ceph-disk behave when it sees the ceph user as 'root' and
invokes things with --setuser root but runs as a non-root user.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoceph-disk: fix get_ceph_user
Sage Weil [Wed, 12 Aug 2015 20:43:38 +0000 (16:43 -0400)]
ceph-disk: fix get_ceph_user

getpwnam throws an exception

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoPendingReleaseNotes: some notes about upgrade and ceph user
Sage Weil [Thu, 6 Aug 2015 14:49:13 +0000 (10:49 -0400)]
PendingReleaseNotes: some notes about upgrade and ceph user

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agosystemd: use --setuser and --setgroup for all daemons
Sage Weil [Thu, 6 Aug 2015 15:57:57 +0000 (11:57 -0400)]
systemd: use --setuser and --setgroup for all daemons

Allow all daemons drop privilege themselves, instead of letting
systemd do it.

Among other things, this means that admins can conditionally not
drop prives by setting

  setuser match path = /var/lib/ceph/$type/$cluster-$id

in their ceph.conf to ease the pain of upgrade.

Signed-off-by: Sage Weil <sage@redhat.com>
Reviewed-by: Boris Ranto <branto@redhat.com>
9 years agoglobal: implement setuser_match_path
Sage Weil [Thu, 6 Aug 2015 15:57:48 +0000 (11:57 -0400)]
global: implement setuser_match_path

Allow the --setuser and --setgroup to be conditional on the
specified user/group matching the ownership of a given path.
This allows the ceph daemons to switch to user ceph for newly
deployed instances or stay as root depending on the ownership of
the data directory.

Signed-off-by: Sage Weil <sage@redhat.com>
Reviewed-by: Boris Ranto <branto@redhat.com>
9 years agoceph-disk: set owner of created files to ceph
Milan Broz [Wed, 5 Aug 2015 12:49:57 +0000 (14:49 +0200)]
ceph-disk: set owner of created files to ceph

Signed-off-by: Milan Broz <mbroz@redhat.com>
9 years agoSet keys owner to ceph user if exists.
Milan Broz [Tue, 23 Jun 2015 14:45:21 +0000 (16:45 +0200)]
Set keys owner to ceph user if exists.

Also fix directory access rigths.

Signed-off-by: Milan Broz <mbroz@redhat.com>
9 years agoSet Ceph device partitions owner to ceph user in udev.
Milan Broz [Wed, 5 Aug 2015 12:25:07 +0000 (14:25 +0200)]
Set Ceph device partitions owner to ceph user in udev.

Signed-off-by: Milan Broz <mbroz@redhat.com>
9 years agoceph-osd-prestart.sh: ensure data dir is root or ceph before start
Sage Weil [Fri, 24 Apr 2015 00:14:27 +0000 (17:14 -0700)]
ceph-osd-prestart.sh: ensure data dir is root or ceph before start

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoinit-ceph.in: Set ceph user and group when running the daemons
Boris Ranto [Thu, 18 Jun 2015 15:02:17 +0000 (17:02 +0200)]
init-ceph.in: Set ceph user and group when running the daemons

Signed-off-by: Boris Ranto <branto@redhat.com>
9 years agoceph.spec.in: User and group must be created in ceph-common pre-install script
Boris Ranto [Thu, 18 Jun 2015 11:42:04 +0000 (13:42 +0200)]
ceph.spec.in: User and group must be created in ceph-common pre-install script

The package ceph-common uses ceph user and group but they are both created in
ceph package %pre phase. We need to move the script to ceph-common %pre phase.

Signed-off-by: Boris Ranto <branto@redhat.com>
9 years agoceph.spec.in: /var/lib/ceph is owned by ceph package
Boris Ranto [Thu, 18 Jun 2015 11:57:47 +0000 (13:57 +0200)]
ceph.spec.in: /var/lib/ceph is owned by ceph package

Signed-off-by: Boris Ranto <branto@redhat.com>
9 years agoceph.spec.in: Fix ceph.limits.d path
Boris Ranto [Wed, 17 Jun 2015 18:06:40 +0000 (20:06 +0200)]
ceph.spec.in: Fix ceph.limits.d path

Signed-off-by: Boris Ranto <branto@redhat.com>
9 years agoceph.spec.in: Fixup uid/gid setting
Boris Ranto [Wed, 17 Jun 2015 15:55:59 +0000 (17:55 +0200)]
ceph.spec.in: Fixup uid/gid setting

We need to set the variables in the %pre phase, otherwise they are not properly
evaluated. Also use /sbin/nolongin instead of /bin/false and set the default
uid/gid pair for fedora and rhel (these were already allocated). We can also
use them for older fedora releases as they are guaranteed to be free.

Signed-off-by: Boris Ranto <branto@redhat.com>
9 years agoceph.spec.in: install ceph.limits.d
Danny Al-Gaaf [Thu, 30 Apr 2015 10:34:08 +0000 (12:34 +0200)]
ceph.spec.in: install ceph.limits.d

limits.d expect the file to end with *.conf. Add the
installed file to package list of the ceph package.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
9 years agoceph.spec.in: add ceph user/group
Danny Al-Gaaf [Sat, 25 Apr 2015 08:04:52 +0000 (10:04 +0200)]
ceph.spec.in: add ceph user/group

Add support of create ceph user/group.

TODO: Add correct number for SUSE.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
9 years agoset nofile ulimit in /etc/security/limits.d/ceph only
Sage Weil [Thu, 6 Aug 2015 15:37:30 +0000 (11:37 -0400)]
set nofile ulimit in /etc/security/limits.d/ceph only

Specify the nofile ulimit in one standard place, where everyone expects it
to be.  Drop it from the ceph-osd unit file.

Leave upstart and sysvinit untouched for the time being to avoid compat
issues.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agosystemd: make ceph-osd setuid/gid to ceph:ceph
Sage Weil [Fri, 24 Apr 2015 00:15:14 +0000 (17:15 -0700)]
systemd: make ceph-osd setuid/gid to ceph:ceph

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoglobal: add --setuser and --setgroup options
Sage Weil [Fri, 24 Apr 2015 21:57:46 +0000 (14:57 -0700)]
global: add --setuser and --setgroup options

These are done after reading config files/environment and before log files
are opened.  Allow a name or id to be specified.  In the case of --setuser,
also switch to that user's gid, unless --setgroup is also specified.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian: fix /var/lib/ceph/* directory ownership
Sage Weil [Fri, 24 Apr 2015 17:28:31 +0000 (10:28 -0700)]
debian: fix /var/lib/ceph/* directory ownership

These dirs are owned by the package; make sure they are owend by the ceph
user.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agosystemd: chown ceph:ceph /var/run/ceph
Sage Weil [Fri, 24 Apr 2015 00:12:34 +0000 (17:12 -0700)]
systemd: chown ceph:ceph /var/run/ceph

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agosystemd: run mon and mds as ceph:ceph
Sage Weil [Fri, 24 Apr 2015 00:12:23 +0000 (17:12 -0700)]
systemd: run mon and mds as ceph:ceph

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agoceph.spec: chown and chmod /var/lib/ceph and /var/log/ceph
Sage Weil [Fri, 24 Apr 2015 00:06:12 +0000 (17:06 -0700)]
ceph.spec: chown and chmod /var/lib/ceph and /var/log/ceph

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian: chown -R ceph:ceph /var/log/ceph
Sage Weil [Fri, 24 Apr 2015 00:03:39 +0000 (17:03 -0700)]
debian: chown -R ceph:ceph /var/log/ceph

The number of log files is generally bounded; safe to chown these.

Allow ceph group members to write to this dir.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian: chown ceph:ceph /var/llib/ceph
Sage Weil [Fri, 24 Apr 2015 00:03:02 +0000 (17:03 -0700)]
debian: chown ceph:ceph /var/llib/ceph

Do not do it recursively--there may already be huge amounts of data
here.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agodebian: create ceph user and group
Sage Weil [Thu, 23 Apr 2015 23:45:50 +0000 (16:45 -0700)]
debian: create ceph user and group

Use Debian base-passwd allocated UID/GID pair.

Signed-off-by: Sage Weil <sage@redhat.com>
9 years agorgw: delete finisher only after finalizing watches 5678/head
Yehuda Sadeh [Wed, 26 Aug 2015 22:08:18 +0000 (15:08 -0700)]
rgw: delete finisher only after finalizing watches

Fixes: #12208
The watch error path might try to schedule a finisher work, delete finisher
only after watch destruction.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
9 years agorgw: init some manifest fields when handling explicit objs 5677/head
Yehuda Sadeh [Wed, 26 Aug 2015 21:34:30 +0000 (14:34 -0700)]
rgw: init some manifest fields when handling explicit objs

Fixes: #11455
When dealing with old manifest that has explicit objs, we also
need to set the head size and head object correctly so that
code that relies on this info doesn't break.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
9 years agoMerge pull request #5625 from liewegas/wip-memcpy
Sage Weil [Wed, 26 Aug 2015 18:11:49 +0000 (14:11 -0400)]
Merge pull request #5625 from liewegas/wip-memcpy

buffer: put inlined memcpy into a header; x86_64 only

Reviewed-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
Reviewed-by: Steve Capper <steve.capper@linaro.org>
Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
9 years agoMerge pull request #5585 from tchaikov/wip-4941
Kefu Chai [Wed, 26 Aug 2015 16:15:12 +0000 (00:15 +0800)]
Merge pull request #5585 from tchaikov/wip-4941

mon,osd: use GMT time for the object name of hitsets

Reviewed-by: Sage Weil <sage@redhat.com>