]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
11 years agorgw_main.cc: remove dead assignment and unused variable
Danny Al-Gaaf [Sun, 11 May 2014 23:43:09 +0000 (01:43 +0200)]
rgw_main.cc: remove dead assignment and unused variable

Fix for:

[src/rgw/rgw_main.cc:1086]: (style) Variable 'frontend_frameworks' is
 assigned a value that is never used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoPGMap.cc: remove dead assignment
Danny Al-Gaaf [Sun, 11 May 2014 23:36:58 +0000 (01:36 +0200)]
PGMap.cc: remove dead assignment

[src/mon/PGMap.cc:865]: (style) Variable 'first' is assigned a value
 that is never used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMDBalancer.cc: remove some since 2009 unused code
Danny Al-Gaaf [Sun, 11 May 2014 23:26:56 +0000 (01:26 +0200)]
MDBalancer.cc: remove some since 2009 unused code

Remove some since long time unused code and variables (commented out
since 2009).

Fix for:

[src/mds/MDBalancer.cc:757]: (style) Variable 'total_sent' is
 assigned a value that is never used.
[src/mds/MDBalancer.cc:665]: (style) Variable 'total_goal' is
 assigned a value that is never used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agochain_xattr.cc: fix memory leak, free 'expected'
Danny Al-Gaaf [Sun, 11 May 2014 23:14:55 +0000 (01:14 +0200)]
chain_xattr.cc: fix memory leak, free 'expected'

Fix for:
[src/test/objectstore/chain_xattr.cc:186]: (error) Memory leak:
 expected

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoconfutils.cc: remove unused variable 'val'
Danny Al-Gaaf [Sun, 11 May 2014 23:09:53 +0000 (01:09 +0200)]
confutils.cc: remove unused variable 'val'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoSyntheticClient.cc: remove double check for "getdir"
Danny Al-Gaaf [Sun, 11 May 2014 22:49:29 +0000 (00:49 +0200)]
SyntheticClient.cc: remove double check for "getdir"

Fix for:
[src/client/SyntheticClient.cc:1143]: (style) Expression is always
 false because 'else if' condition matches previous condition at line 1139.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw_op.cc: reduce scope of 'int r' in execute()
Danny Al-Gaaf [Sun, 11 May 2014 22:38:48 +0000 (00:38 +0200)]
rgw_op.cc: reduce scope of 'int r' in execute()

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw_op.cc: use static_cast instead of c-style cast
Danny Al-Gaaf [Sun, 11 May 2014 22:33:00 +0000 (00:33 +0200)]
rgw_op.cc: use static_cast instead of c-style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw_quota.cc: remove unused variable 'key'
Danny Al-Gaaf [Sun, 11 May 2014 22:27:37 +0000 (00:27 +0200)]
rgw_quota.cc: remove unused variable 'key'

[src/rgw/rgw_quota.cc:455]: (style) Variable 'key' is assigned a
 value that is never used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_log.cc: prefer ++operators for iterators
Danny Al-Gaaf [Sun, 11 May 2014 22:06:55 +0000 (00:06 +0200)]
test_rgw_admin_log.cc: prefer ++operators for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_cls_rbd.cc: use 'delete []' if 'new char[len]' was used
Danny Al-Gaaf [Sun, 11 May 2014 22:05:15 +0000 (00:05 +0200)]
test_cls_rbd.cc: use 'delete []' if 'new char[len]' was used

Fix for:
[src/test/cls_rbd/test_cls_rbd.cc:82]: (error) Mismatching allocation
 and deallocation: b
[src/test/cls_rbd/test_cls_rbd.cc:95]: (error) Mismatching allocation
 and deallocation: b
[src/test/cls_rbd/test_cls_rbd.cc:97]: (error) Mismatching allocation
 and deallocation: b

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_log.cc: prefer empty() over size() for emptiness check
Danny Al-Gaaf [Sun, 11 May 2014 21:25:36 +0000 (23:25 +0200)]
test_rgw_admin_log.cc: prefer empty() over size() for emptiness check

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_opstate.cc: prefer ++operators for iterators
Danny Al-Gaaf [Sun, 11 May 2014 21:22:42 +0000 (23:22 +0200)]
test_rgw_admin_opstate.cc: prefer ++operators for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_admin_meta.cc: prefer ++operators for iterators
Danny Al-Gaaf [Sun, 11 May 2014 21:21:50 +0000 (23:21 +0200)]
test_rgw_admin_meta.cc: prefer ++operators for iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoTestErasureCodePluginJerasure.cc: prefer ++operators for non-primitive types
Danny Al-Gaaf [Sun, 11 May 2014 21:17:14 +0000 (23:17 +0200)]
TestErasureCodePluginJerasure.cc: prefer ++operators for non-primitive types

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest/ObjectMap/KeyValueDBMemory.cc: use empty() instead of size()
Danny Al-Gaaf [Sun, 11 May 2014 21:13:00 +0000 (23:13 +0200)]
test/ObjectMap/KeyValueDBMemory.cc: use empty() instead of size()

Use empty() instead of 'size() == 0' to fix:

[src/test/ObjectMap/KeyValueDBMemory.cc:83]: (performance)
 Possible inefficient checking for 'db' emptiness.
[src/test/ObjectMap/KeyValueDBMemory.cc:97]: (performance)
 Possible inefficient checking for 'db' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoFileStore.cc: remove some dead assignments
Danny Al-Gaaf [Sun, 11 May 2014 11:52:37 +0000 (13:52 +0200)]
FileStore.cc: remove some dead assignments

There is no need to reset 'r' to '0'.

Fix for:
3759 r = 0;
     Value stored to 'r' is never read

4093 r = 0;
     Value stored to 'r' is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agocls_kvs.cc: return 'r' from get_idata_from_key()
Danny Al-Gaaf [Sun, 11 May 2014 09:55:28 +0000 (11:55 +0200)]
cls_kvs.cc: return 'r' from get_idata_from_key()

Fix for:

69  r = 0;
    Value stored to 'r' is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agocls_kvs.cc: remove dead assignment
Danny Al-Gaaf [Sun, 11 May 2014 09:52:04 +0000 (11:52 +0200)]
cls_kvs.cc: remove dead assignment

Fix for:
[src/key_value_store/cls_kvs.cc:383] -> [src/key_value_store/cls_kvs.cc:386]:
 (performance) Variable 'r' is reassigned a value before the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw_user.cc:
Danny Al-Gaaf [Sun, 11 May 2014 09:28:26 +0000 (11:28 +0200)]
rgw_user.cc:

Remove bool variable 'same_email' compare emails directly in
if check.

Fix for:
[src/rgw/rgw_user.cc:1926] -> [src/rgw/rgw_user.cc:1927]: (performance)
 Variable 'same_email' is reassigned a value before the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agolibcephfs.cc: fix possible NULL pointer deref
Danny Al-Gaaf [Sat, 10 May 2014 22:36:20 +0000 (00:36 +0200)]
libcephfs.cc: fix possible NULL pointer deref

Fix possible NULL pointer dereference of 'inode' in ceph_ll_lookup_inode().
It's not enough to check for 'inode' without assert or error handling before
assert for '*inode != NULL' since this doesn't handle the 'inode == NULL'
case for the later calls.

Fix for:
1192 r = (cmount->get_client())->lookup_parent(*inode, &parent);
     5  Dereference of null pointer (loaded from variable 'inode')

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoosd/OSD.cc: fix possible NULL pointer deref in share_map()
Danny Al-Gaaf [Sat, 10 May 2014 19:37:07 +0000 (21:37 +0200)]
osd/OSD.cc: fix possible NULL pointer deref in share_map()

Fix for:

4778 *sent_epoch_p = osdmap->get_epoch();
     12 Dereference of null pointer (loaded from variable 'sent_epoch_p')

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomds/flock.cc: remove dead initialization of 'new_lock_end'
Danny Al-Gaaf [Sat, 10 May 2014 17:18:35 +0000 (19:18 +0200)]
mds/flock.cc: remove dead initialization of 'new_lock_end'

Fix for:

213 uint64_t new_lock_end = new_lock.start + new_lock.length - 1;
    Value stored to 'new_lock_end' during its initialization is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomds/flock.cc: remove dead initialization of 'new_lock_start'
Danny Al-Gaaf [Sat, 10 May 2014 17:13:48 +0000 (19:13 +0200)]
mds/flock.cc: remove dead initialization of 'new_lock_start'

Fix for:

212 uint64_t new_lock_start = new_lock.start;
    Value stored to 'new_lock_start' during its initialization is
    never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomds/Server.cc: remove unused initialization of 'destdnl'
Danny Al-Gaaf [Sat, 10 May 2014 17:06:32 +0000 (19:06 +0200)]
mds/Server.cc: remove unused initialization of 'destdnl'

Remove initialization of 'destdnl' since the assigned value was
never used and the same call is used some lines later again before
first usage. Fix for:

6579 CDentry::linkage_t *destdnl = destdn->get_linkage();
     Value stored to 'destdnl' during its initialization is never read

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd.cc: remove used parameter from set_pool_image_name()
Danny Al-Gaaf [Sat, 10 May 2014 09:51:41 +0000 (11:51 +0200)]
rbd.cc: remove used parameter from set_pool_image_name()

Removed unused 'orig_pool' parameter from set_pool_image_name().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_librbd.cc: fix sizeof() in malloc call
Danny Al-Gaaf [Sat, 10 May 2014 08:58:56 +0000 (10:58 +0200)]
test_librbd.cc: fix sizeof() in malloc call

Use 'char' instead of 'char *'.

228  names = (char *) malloc(sizeof(char *) * 1024);
     Result of 'malloc' is converted to a pointer of type 'char',
     which is incompatible with sizeof operand type 'char *'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoCrushWrapper.cc: fix sizeof() call in calloc
Danny Al-Gaaf [Sat, 10 May 2014 08:50:32 +0000 (10:50 +0200)]
CrushWrapper.cc: fix sizeof() call in calloc

Use __u32 instead of __s32 due to type of bucket->parm to fix:

1028 bucket->perm = (__u32*)calloc(1, bucket->size * sizeof(__s32));
     Result of 'calloc' is converted to a pointer of type '__u32',
     which is incompatible with sizeof operand type '__s32'

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1781 from ceph/wip-8269
Josh Durgin [Fri, 9 May 2014 21:44:25 +0000 (14:44 -0700)]
Merge pull request #1781 from ceph/wip-8269

Wip 8269

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agomsg: Fix inconsistent message sequence negotiation during connection reset
Guang Yang [Fri, 9 May 2014 09:21:23 +0000 (09:21 +0000)]
msg: Fix inconsistent message sequence negotiation during connection reset

Backport: firefly, emperor, dumpling

Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
Reviewed-by: Greg Farnum <greg@inktank.com>
11 years agoMerge pull request #1796 from daniel-j-h/missing_initializers
Sage Weil [Fri, 9 May 2014 18:03:06 +0000 (11:03 -0700)]
Merge pull request #1796 from daniel-j-h/missing_initializers

Fixed missing initializers issues

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1797 from ceph/wip-7588
Sage Weil [Fri, 9 May 2014 18:01:46 +0000 (11:01 -0700)]
Merge pull request #1797 from ceph/wip-7588

osd/ReplicatedPG: carry CopyOpRef in copy_from completion

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge tag 'v0.80'
Sage Weil [Fri, 9 May 2014 17:58:35 +0000 (10:58 -0700)]
Merge tag 'v0.80'

v0.80

Conflicts:
src/osd/PG.cc
src/osd/ReplicatedPG.cc

11 years agoMerge pull request #1798 from ceph/wip-8319
Sage Weil [Fri, 9 May 2014 17:45:42 +0000 (10:45 -0700)]
Merge pull request #1798 from ceph/wip-8319

osd: fix race during shutdown

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1731 from dynamike67/patch-2
John Wilkins [Fri, 9 May 2014 17:33:33 +0000 (10:33 -0700)]
Merge pull request #1731 from dynamike67/patch-2

doc: Changed the java code example

11 years agoosd: fix MOSDMarkMeDown name
Sage Weil [Fri, 9 May 2014 16:06:42 +0000 (09:06 -0700)]
osd: fix MOSDMarkMeDown name

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1792 from nereocystis/Ceph-osd-is-daemon
John Wilkins [Fri, 9 May 2014 17:28:52 +0000 (10:28 -0700)]
Merge pull request #1792 from nereocystis/Ceph-osd-is-daemon

:doc Ceph OSD is standard name

11 years agoMerge pull request #1786 from nereocystis/quick-common
John Wilkins [Fri, 9 May 2014 17:27:53 +0000 (10:27 -0700)]
Merge pull request #1786 from nereocystis/quick-common

doc: Common graph used in 2 quick start files

11 years agoMerge pull request #1732 from dynamike67/master
John Wilkins [Fri, 9 May 2014 17:22:15 +0000 (10:22 -0700)]
Merge pull request #1732 from dynamike67/master

doc: Added Java Example

11 years agoosd: handle race between osdmap and prepare_to_stop 1798/head
Sage Weil [Fri, 9 May 2014 16:20:34 +0000 (09:20 -0700)]
osd: handle race between osdmap and prepare_to_stop

If we get a MOSDMarkMeDown message and set service.state == STOPPING, we
kick the prepare_to_stop() thread.  Normally, it will wake up and then
set osd.state == STOPPING, and when we process the map message next we
will not warn.  However, if dispatch() takes the lock instead and processes
the map, it will fail the preparing_to_stop check and issue a spurious
warning.

Fix by checking for either preparing_to_stop or stopping.

Fixes: #8319
Backport: firefly, emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoosd: fix state method whitespace
Sage Weil [Fri, 9 May 2014 16:12:42 +0000 (09:12 -0700)]
osd: fix state method whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoFixed missing initializers issues 1796/head
Daniel J. Hofmann [Fri, 9 May 2014 15:25:07 +0000 (17:25 +0200)]
Fixed missing initializers issues

Signed-off-by: Daniel J. Hofmann <daniel@trvx.org>
11 years agoMerge pull request #1795 from daniel-j-h/extra_semicolons
Sage Weil [Fri, 9 May 2014 13:49:28 +0000 (06:49 -0700)]
Merge pull request #1795 from daniel-j-h/extra_semicolons

Removed extra semicolons

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoRemoved extra semicolons 1795/head
Daniel J. Hofmann [Fri, 9 May 2014 13:07:15 +0000 (15:07 +0200)]
Removed extra semicolons

Signed-off-by: Daniel J. Hofmann <daniel@trvx.org>
11 years agoMerge pull request #1772 from ceph/wip-8169
Josh Durgin [Thu, 8 May 2014 22:35:45 +0000 (15:35 -0700)]
Merge pull request #1772 from ceph/wip-8169

rgw: calculate user manifest

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years ago:doc Ceph OSD is standard name 1792/head
Kevin Dalley [Sat, 3 May 2014 01:38:08 +0000 (18:38 -0700)]
:doc Ceph OSD is standard name
This is a method of standardizing the usage of OSD so that "Ceph OSD"
is the daemon, and OSD maintains its industry standard usage of Object
Storage Device.

Signed-off-by: Kevin Dalley <kevin@kelphead.org>
11 years agorgw: calculate user manifest 1772/head
Yehuda Sadeh [Mon, 21 Apr 2014 22:07:12 +0000 (15:07 -0700)]
rgw: calculate user manifest

Fixes: #8169
Backport: firefly
We didn't calculate the user manifest's object etag at all. The etag
needs to be the md5 of the contantenation of all the parts' etags.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
11 years agoosd/ReplicatedPG: carry CopyOpRef in copy_from completion 1797/head
Sage Weil [Thu, 8 May 2014 21:19:22 +0000 (14:19 -0700)]
osd/ReplicatedPG: carry CopyOpRef in copy_from completion

There is a race with copy_from cancellation.  The internal Objecter
completion decodes a bunch of data and copies it into pointers provided
when the op is queued.  When we cancel, we need to ensure that we can cope
until control passes back to our provided completion.

Once we *do* get into the (ReplicatedPG) callbacks, we will bail out
because the tid in the CopyOp or FlushOp no longer matches.

Fix this by carrying a ref to keep the copy-from targets alive, and
clearing out the tids that we cancel.

Note that previously, the trigger for this was that the tid changes when
we handle a redirect, which made the op_cancel() call fail.  With the
coming Objecter changes, this will no longer be the case.  However, there
are also locking and threading changes that will make cancellation racy,
so we will not be able to rely on it always preventing the callback.
Either way, this will avoid the problem.

Fixes: #7588
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1791 from ceph/wip-8011
Samuel Just [Thu, 8 May 2014 20:50:19 +0000 (13:50 -0700)]
Merge pull request #1791 from ceph/wip-8011

ReplicatedPG: block scrub on blocked object contexts

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoReplicatedPG: block scrub on blocked object contexts 1791/head
Samuel Just [Tue, 6 May 2014 18:50:14 +0000 (11:50 -0700)]
ReplicatedPG: block scrub on blocked object contexts

Fixes: #8011
Backport: firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1778 from ceph/wip-7157
Alfredo Deza [Thu, 8 May 2014 16:13:58 +0000 (12:13 -0400)]
Merge pull request #1778 from ceph/wip-7157

ceph-disk: fix list for encrypted or corrupt volume

Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>
11 years agoMerge pull request #1789 from ceph/wip-jcsp-clang
Sage Weil [Thu, 8 May 2014 16:07:28 +0000 (09:07 -0700)]
Merge pull request #1789 from ceph/wip-jcsp-clang

misc. cleanups from clang warnings

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1777 from ceph/wip-6966
Alfredo Deza [Thu, 8 May 2014 16:00:28 +0000 (12:00 -0400)]
Merge pull request #1777 from ceph/wip-6966

ceph-disk: partprobe before settle when preparing dev

Reviewed-by: Alfredo Deza <alfredo.deza@inktank.com>
11 years agoceph-disk: partprobe before settle when preparing dev 1777/head
Sage Weil [Thu, 8 May 2014 15:52:51 +0000 (08:52 -0700)]
ceph-disk: partprobe before settle when preparing dev

Two users have reported this fixes a problem with using --dmcrypt.

Fixes: #6966
Tested-by: Eric Eastman <eric0e@aol.com>
Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1788 from ceph/wip-da-sca-20140507
Sage Weil [Thu, 8 May 2014 15:47:05 +0000 (08:47 -0700)]
Merge pull request #1788 from ceph/wip-da-sca-20140507

Fix some issues from SCA

11 years agoMerge pull request #1790 from ceph/wip-krbd-fixes
Sage Weil [Thu, 8 May 2014 15:33:54 +0000 (08:33 -0700)]
Merge pull request #1790 from ceph/wip-krbd-fixes

Two minor krbd fixes

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agorbd-fuse.c: remove ridiculous linebreak 1788/head
Danny Al-Gaaf [Thu, 8 May 2014 15:08:32 +0000 (17:08 +0200)]
rbd-fuse.c: remove ridiculous linebreak

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd-fuse.c: fix indentation
Danny Al-Gaaf [Thu, 8 May 2014 15:05:48 +0000 (17:05 +0200)]
rbd-fuse.c: fix indentation

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd-fuse.c: fix -Wmissing-field-initializers
Danny Al-Gaaf [Thu, 8 May 2014 14:59:45 +0000 (16:59 +0200)]
rbd-fuse.c: fix -Wmissing-field-initializers

Init image_name with NULL to fix:

rbd_fuse/rbd-fuse.c:57:63: warning: missing field 'image_name' initializer
 [-Wmissing-field-initializers]
 struct rbd_options rbd_options = {"/etc/ceph/ceph.conf", "rbd"};

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agokrbd: fix sysfs path in the comment 1790/head
Ilya Dryomov [Thu, 8 May 2014 14:17:48 +0000 (18:17 +0400)]
krbd: fix sysfs path in the comment

It's "/sys/bus/rbd/devices/<id>", but libudev works with devices and
not busses, so it's really "/sys/devices/rbd/<id>/".

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
11 years agokrbd: match new with delete, not free()
Ilya Dryomov [Thu, 8 May 2014 14:17:48 +0000 (18:17 +0400)]
krbd: match new with delete, not free()

struct krbd_ctx is allocated with new, use delete to get rid of it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
11 years agorbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized
Danny Al-Gaaf [Thu, 8 May 2014 14:09:07 +0000 (16:09 +0200)]
rbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized

Init 'snap_protected' with false to fix:

rbd.cc:544:35: warning: variable 'snap_protected' may be uninitialized
 when used here [-Wconditional-uninitialized]
      f->dump_string("protected", snap_protected ? "true" : "false");
                                  ^~~~~~~~~~~~~~
rbd.cc:482:22: note: initialize the variable 'snap_protected' to silence
 this warning
  bool snap_protected;
                     ^
                      = false

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorbd-fuse.c: init 'rbd' in open_rbd_image()
Danny Al-Gaaf [Thu, 8 May 2014 14:04:18 +0000 (16:04 +0200)]
rbd-fuse.c: init 'rbd' in open_rbd_image()

Init 'rbd' in open_rbd_image() with NULL and add a check for
'rbd' before dereference it to fix:

rbd_fuse/rbd-fuse.c:182:29: warning: variable 'rbd' may be uninitialized
 when used here [-Wconditional-uninitialized]
        int ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
                                  ^~~
rbd_fuse/rbd-fuse.c:151:27: note: initialize the variable 'rbd' to silence
 this warning
        struct rbd_openimage *rbd;
                                 ^
                                  = NULL

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoObjectCacher::_wait_for_write(): init 'bool done'
Danny Al-Gaaf [Thu, 8 May 2014 13:54:24 +0000 (15:54 +0200)]
ObjectCacher::_wait_for_write(): init 'bool done'

Init 'bool done' with 'false' to fix:

osdc/Objecter.h:915:27: warning: implicit conversion los: variable 'done'
 may be uninitialized when used here [-Wconditional-uninitialized]
      while (!done)
              ^~~~
osdc/ObjectCacher.cc:1399:14: note: initialize the variable 'done' to
 silence this warning
    bool done;
             ^
              = false

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoObjecter::calc_target(): init best_locality with 0
Danny Al-Gaaf [Thu, 8 May 2014 13:47:08 +0000 (15:47 +0200)]
Objecter::calc_target(): init best_locality with 0

Init best_locality to fix:

osdc/Objecter.cc:1519:26: warning: variable 'best_locality' may be
 uninitialized when used here [-Wconditional-uninitialized]
              (locality >= 0 && best_locality >= 0 &&
                                ^~~~~~~~~~~~~
osdc/Objecter.cc:1511:19: note: initialize the variable 'best_locality'
 to silence this warning
        int best_locality;
                         ^
                          = 0

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw: Remove trailing ; from fn definitions 1789/head
John Spray [Thu, 8 May 2014 10:40:38 +0000 (11:40 +0100)]
rgw: Remove trailing ; from fn definitions

Clang:
warning: extra ';' after member function
definition [-Wextra-semi]

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agoos/FileJournal: remove unused attribute
John Spray [Thu, 8 May 2014 10:31:49 +0000 (11:31 +0100)]
os/FileJournal: remove unused attribute

Clang:
os/FileJournal.h:224:8: warning: private field 'is_bdev' is not used
[-Wunused-private-field]

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agomon: Fix % escaping (\% should be %%)
John Spray [Thu, 8 May 2014 10:04:46 +0000 (11:04 +0100)]
mon: Fix % escaping (\% should be %%)

Clang's -Wpedantic points this out.

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agomds: Remove redundant 'using namespace std'
John Spray [Tue, 6 May 2014 15:53:20 +0000 (08:53 -0700)]
mds: Remove redundant 'using namespace std'

This simply was not being used, and triggered
a clang warning.

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agoencoding: make .size() to __u32 cast explicit
John Spray [Tue, 6 May 2014 15:49:53 +0000 (08:49 -0700)]
encoding: make .size() to __u32 cast explicit

Caught by clang warning that this is a conversion
from "unsigned long" to "unsigned int" which can
lose precision.  However, this is the conversion
we want because our serialization format defines
sizes as 4 bytes.

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agofragtree: remove unused and broken verify()
John Spray [Tue, 6 May 2014 15:48:08 +0000 (16:48 +0100)]
fragtree: remove unused and broken verify()

This fn had a while(1) with no break: if anyone
had called it it would block forever.

Caught by clang's "function 'verify' could be declared
with attribute 'noreturn'" warning.

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agofragtree: remove dead code
John Spray [Tue, 6 May 2014 15:45:17 +0000 (16:45 +0100)]
fragtree: remove dead code

Signed-off-by: John Spray <john.spray@inktank.com>
11 years agoremove superfluous second semicolons at end of lines
Danny Al-Gaaf [Thu, 8 May 2014 08:09:25 +0000 (10:09 +0200)]
remove superfluous second semicolons at end of lines

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agomsg: fix some -Wextra-semi warnings
Danny Al-Gaaf [Thu, 8 May 2014 07:38:28 +0000 (09:38 +0200)]
msg: fix some -Wextra-semi warnings

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agocrush/builder.c: remove some unreachable return statements
Danny Al-Gaaf [Thu, 8 May 2014 07:34:21 +0000 (09:34 +0200)]
crush/builder.c: remove some unreachable return statements

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1742 from ceph/wip-multimds
Yan, Zheng [Thu, 8 May 2014 03:36:23 +0000 (11:36 +0800)]
Merge pull request #1742 from ceph/wip-multimds

Wip multimds

11 years agomds: remove unused MMDSCacheRejoin::{MISSING,FULL} 1742/head
Yan, Zheng [Mon, 5 May 2014 08:53:55 +0000 (16:53 +0800)]
mds: remove unused MMDSCacheRejoin::{MISSING,FULL}

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
11 years agomds: properly wake up dentry waiters after fragmenting dirfrag
Yan, Zheng [Mon, 5 May 2014 08:23:14 +0000 (16:23 +0800)]
mds: properly wake up dentry waiters after fragmenting dirfrag

When active MDS wants to fragment a replica dirfrag, it should set
the 'replay' parameter of MDCache::adjust_dir_fragments() to false.
It makes sure that CDir::merge/split wake up any dentry waiter.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
11 years agomds: choose MIX state if replica of scatterlock is in MIX state
Yan, Zheng [Mon, 5 May 2014 06:36:16 +0000 (14:36 +0800)]
mds: choose MIX state if replica of scatterlock is in MIX state

After ScatterLock::infer_state_from_strong_rejoin() set scatterlock
to LOCK_MIX state, don't change the scatterlock to other state.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
11 years agomds: switch flushing ScatterLock to dirty ScatterLock after cache rejoin
Yan, Zheng [Sun, 4 May 2014 15:06:32 +0000 (23:06 +0800)]
mds: switch flushing ScatterLock to dirty ScatterLock after cache rejoin

Otherwise the flushing flag may confuse Locker::eval_gather() if MDS later
imports lock's parent inode.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
11 years agoMerge pull request #1766 from ceph/wip-fsx-krbd
Josh Durgin [Thu, 8 May 2014 01:13:04 +0000 (18:13 -0700)]
Merge pull request #1766 from ceph/wip-fsx-krbd

krbd mode for librbd_fsx

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
11 years agodoc: Common graph used in 2 quick start files 1786/head
Kevin Dalley [Thu, 8 May 2014 01:01:52 +0000 (18:01 -0700)]
doc: Common graph used in 2 quick start files

The graph in quick-ceph-deploy.rst applies to
quick-start-preflight.rst.
The graph in deploy seems more complete, so I put the common
documentation in quick-common.rst and had it included.
doc/conf.py has 'start/quick-common.rst' in exclude patterns so that
sphinx does not complain about this file not being in toc.

Signed-off-by: Kevin Dalley <kevin@kelphead.org>
11 years agoMerge pull request #1780 from ceph/wip-8299
Sage Weil [Wed, 7 May 2014 22:14:47 +0000 (15:14 -0700)]
Merge pull request #1780 from ceph/wip-8299

rgw: fix stripe_size calculation

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1776 from ceph/wip-8289
Sage Weil [Wed, 7 May 2014 22:03:31 +0000 (15:03 -0700)]
Merge pull request #1776 from ceph/wip-8289

rgw: cut short object read if a chunk returns error

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agoMerge pull request #1773 from ceph/wip-8170
Sage Weil [Wed, 7 May 2014 21:53:04 +0000 (14:53 -0700)]
Merge pull request #1773 from ceph/wip-8170

rgw: send user manifest header field

Reviewed-by: Sage Weil <sage@inktank.com>
11 years agovstart.sh: fix client admin socket path
Sage Weil [Wed, 7 May 2014 21:46:53 +0000 (14:46 -0700)]
vstart.sh: fix client admin socket path

Signed-off-by: Sage Weil <sage@inktank.com>
11 years agoECUtil.h: clarify calculation with braces
Danny Al-Gaaf [Wed, 7 May 2014 19:18:44 +0000 (21:18 +0200)]
ECUtil.h: clarify calculation with braces

Fix for cppcheck issue:
 [src/osd/ECUtil.h:61]: (style) Clarify calculation
  precedence for '%' and '?'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1783 from guangyy/folder-merge-doc
Samuel Just [Wed, 7 May 2014 18:05:59 +0000 (11:05 -0700)]
Merge pull request #1783 from guangyy/folder-merge-doc

Update doc to reflect the bahavior change for filestore_merge_threshold setting.

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agoMerge pull request #1784 from ceph/wip-da-cleanup-includes
Samuel Just [Wed, 7 May 2014 18:05:07 +0000 (11:05 -0700)]
Merge pull request #1784 from ceph/wip-da-cleanup-includes

Cleanup some included headers

Reviewed-by: Samuel Just <sam.just@inktank.com>
11 years agorgw_acl_swift.h: fix #define header guard
Danny Al-Gaaf [Wed, 7 May 2014 16:52:49 +0000 (18:52 +0200)]
rgw_acl_swift.h: fix #define header guard

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agorgw_rest_metadata.cc: fix -Wparentheses-equality
Danny Al-Gaaf [Wed, 7 May 2014 16:02:51 +0000 (18:02 +0200)]
rgw_rest_metadata.cc: fix -Wparentheses-equality

Fix for:
warning: equality comparison with extraneous parentheses
 [-Wparentheses-equality]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoReplicatedPG.cc: fix -Wparentheses
Danny Al-Gaaf [Wed, 7 May 2014 16:00:10 +0000 (18:00 +0200)]
ReplicatedPG.cc: fix -Wparentheses

Fix for:
warning: using the result of an assignment as  a condition
 without parentheses [-Wparentheses]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_rgw_manifest.cc: fix VLA of non-POD element type
Danny Al-Gaaf [Wed, 7 May 2014 15:28:31 +0000 (17:28 +0200)]
test_rgw_manifest.cc: fix VLA of non-POD element type

Use vector to fix:
test/rgw/test_rgw_manifest.cc:184:20: error: variable length array
 of non-POD element type 'RGWObjManifest'
  RGWObjManifest pm[num_parts];

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1775 from ceph/wip-rbd-clang
Danny Al-Gaaf [Wed, 7 May 2014 13:47:56 +0000 (15:47 +0200)]
Merge pull request #1775 from ceph/wip-rbd-clang

fix clang-analyzer warnings in rbd and objectcacher

Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agoMerge pull request #1782 from xinglin/coverity-fixes
Danny Al-Gaaf [Wed, 7 May 2014 13:34:30 +0000 (15:34 +0200)]
Merge pull request #1782 from xinglin/coverity-fixes

test/libcephfs/test.cc: free cmount structure before return

Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
11 years agotest_librbd_fsx: align temporary buffers allocated in check_clone() 1766/head
Ilya Dryomov [Wed, 7 May 2014 13:19:53 +0000 (17:19 +0400)]
test_librbd_fsx: align temporary buffers allocated in check_clone()

check_clone() allocates temporary good_buf and temp_buf with malloc(),
which is not good enough for krbd with O_DIRECT.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
11 years agotest_librbd_fsx: wire up O_DIRECT mode
Ilya Dryomov [Wed, 7 May 2014 13:19:53 +0000 (17:19 +0400)]
test_librbd_fsx: wire up O_DIRECT mode

Wire up O_DIRECT mode (-Z) for krbd, to have a workaround for possible
problems with BLKDISCARD leaving stale entries in the buffer cache in
place.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
11 years agotest_librbd_fsx: fix a bug in docloseopen()
Ilya Dryomov [Fri, 2 May 2014 11:13:11 +0000 (15:13 +0400)]
test_librbd_fsx: fix a bug in docloseopen()

docloseopen() always opens $iname image.  This is bad, because the
image we had opened could have been something like $iname-clone3.  Fix
it by leveraging the fact that rbd_ctx has an image name field.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
11 years agotest_librbd_fsx: add krbd mode support
Ilya Dryomov [Fri, 2 May 2014 11:13:11 +0000 (15:13 +0400)]
test_librbd_fsx: add krbd mode support

Add krbd mode support (-K) to test krbd in the same way librbd is
tested.  This introduces a dependency on libkrbd and, because it's
a C++ static library, requires C++ linking.  The rbd_operations
framework can be extended in the future to also test rbd_fuse.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
11 years agotest_librbd_fsx: add a flag to disable randomized striping
Ilya Dryomov [Thu, 1 May 2014 12:08:03 +0000 (16:08 +0400)]
test_librbd_fsx: add a flag to disable randomized striping

In preparation for krbd mode support, introduce an option to disable
randomized striping.  The kernel as of 3.15 does not support "fancy"
striping and will not map images with non-default striping values.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>