common: seq_read_bench argument order changed
The argument order for seq_read_bench in src/common/obj_bencher.h has
been changed to match the argument order in obj_bencher.cc

Calls to seq_read_bench already use the correct order.
seq_read_bench also matches the order of rand_read_bench and
write_bench

Signed-off-by: Kevin Dalley <kevin@kelphead.org>
librbd: use order-agnostic default stripe parameters

This way the default striping style of splitting into
object-sized chunks still works with non-default orders
specified.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: remove accidental repeated option

--stripe-count is already parsed above this

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: respect rbd_default_* parameters

Treat rbd_default_{format,order,stripe_unit,stripe_count} as defaults for
the usual arguments for specifying those properties.

librbd::create() is affected by rbd_default_format, so we need to
explicitly override it if --image-format is set. The rest of the
parameters are passed explicitly when they are used, so their rbd_default
equivalents don't matter.

Fixes: #8821
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
remove ceph restarts on upgrades for RPMs

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
remove suse service restarts

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
Merge pull request #2109 from ceph/wip-8849

remove ceph restarts on upgrades for RPMs

Backport: firefly
Reviewed-by: Sage Weil <sage@redhat.com>
logrotate.conf: fix osd log rotation under upstart

In commit 7411c3c6a42bef5987bdd76b1812b01686303502 we generalized this
enumeration code by copying what was in the upstart scripts.  However,
while the mon and mds directories get a 'done' file, the OSDs get a 'ready'
file.  Bah!  Trigger off of either one.

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2116 from ceph/wip-logrotate

logrotate.conf: fix osd log rotation

Reviewed-by: Dan Mick <dan.mick@inktank.com>
rgw: fix decoding + characters in URL

Fixes: #8702
Backport: firefly

Only decode + characters to spaces if we're in a query argument. The +
query argument.  The + => ' ' translation is not correct for
file/directory names.

Resolves http://tracker.ceph.com/issues/8702

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
Signed-off-by: Brian Rak <dn@devicenull.org>
osd: init local_connection for fast_dispatch in _send_boot()

We were not properly setting up Sessions on the local_connection for
fast_dispatch'ed Messages if the cluster_addr was set explicitly: the OSD
was not in the dispatch list at bind() time (in ceph_osd.cc), and nothing
called it later on. This issue was missed in testing because Inktank only
uses unified NICs.

That led to errors like the following:

When do ec-read, i met a bug which was occured 100%. The messages are:
2014-07-14 10:03:07.318681 7f7654f6e700 -1 osd/OSD.cc: In function
'virtual void OSD::ms_fast_dispatch(Message*)' thread 7f7654f6e700 time
2014-07-14 10:03:07.316782 osd/OSD.cc: 5019: FAILED assert(session)

 ceph version 0.82-585-g79f3f67 (79f3f6749122ce2944baa70541949d7ca75525e6)
 1: (OSD::ms_fast_dispatch(Message*)+0x286) [0x6544b6]
 2: (DispatchQueue::fast_dispatch(Message*)+0x56) [0xb059d6]
 3: (DispatchQueue::run_local_delivery()+0x6b) [0xb08e0b]
 4: (DispatchQueue::LocalDeliveryThread::entry()+0xd) [0xa4a5fd]
 5: (()+0x8182) [0x7f7665670182]
 6: (clone()+0x6d) [0x7f7663a1130d]
 NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.

To resolve this, we have the OSD invoke ms_handle_fast_connect() explicitly
in send_boot(). It's not really an appropriate location, but we're already
doing a bunch of messenger twiddling there, so it's acceptable for now.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 9061988ec7eaa922e2b303d9eece86e7c8ee0fa1)
init: add systemd service files

This patch adds systemd service files. It is possible to start and
enable multiple instances (per monid, osdid, mds name), e.g.

 # systemctl start ceph-mon@node01
 # systemctl enable ceph-mon@node01

 # systemctl start ceph-osd@0
 # systemctl enable ceph-osd@0

The ceph cluster can be set in the system config file:

 /etc/sysconfig/ceph

adding or editing the CLUSTER environment variable.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
osd: allow greedy get_write() for ObjectContext locks

There are several lockers that need to take a write lock
because there is an operation that is already in progress and
know it is safe to do so.  In particular, they need to skip
the starvation checks (op waiters, backfill waiting).

Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: greedily take write_lock for copyfrom finish, snapdir

In the cases where we are taking a write lock and are careful
enough that we know we should succeed (i.e, we assert(got)),
use the get_write_greedy() variant that skips the checks for
waiters (be they ops or backfill) that are normally necessary
to avoid starvation.  We don't care about staration here
because our op is already in-progress and can't easily be
aborted, and new ops won't start because they do make those
checks.

Fixes: #8889
Signed-off-by: Sage Weil <sage@redhat.com>
osd/ReplicatedPG: debug obc locks

Signed-off-by: Sage Weil <sage@redhat.com>
common/RandomCache: Fix inconsistence between contents and count

The add/clear method may cause count inconsistent with the real size of
contents.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Merge pull request #2136 from yuyuyu101/fix-randomcache

common/RandomCache: Fix inconsistence between contents and count

Reviewed-by: Sage Weil <sage@redhat.com>
common/random_cache: fix typo

Signed-off-by: Sage Weil <sage@redhat.com>
ceph.spec.in: split out ceph-common as in Debian

Move files, postun scriptlet, and add dependencies on ceph-common
where appropriate

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit e131b9d5a5e90e87d8a8346cb96cb5a26135c144)
ceph.spec.in: whitespace fixes

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(cherry picked from commit ec8af52a5ede78511423a1455a496d46d580c644)