John Spray [Tue, 13 May 2014 16:32:03 +0000 (17:32 +0100)]
doc: update instructions for RPM distros
Fix RPM building instructions: this has been broken since
libs3 was included inline in the ceph repo as a submodule.
"rpmbuild -tb" was concatenating the ceph.spec and
libs3.spec files, resulting in something that didn't work.
Also, the instructions suggested downloading a .tar.gz file
whereas the specfile requires a .tar.bz2 file.
Also, add a convenient yum command line for getting the compile
dependencies on Fedora 20.
Signed-off-by: John Spray <john.spray@inktank.com>
Danny Al-Gaaf [Mon, 12 May 2014 00:33:44 +0000 (02:33 +0200)]
BtrfsFileStoreBackend.cc: fix ::unlinkat() result handling
Don't check for 'fd' but for the return value of the ::unlinkat() call.
Fix for:
[src/os/BtrfsFileStoreBackend.cc:72] -> [src/os/BtrfsFileStoreBackend.cc:74]:
(warning) Opposite conditions in nested 'if' blocks lead to a dead code block.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Mon, 12 May 2014 00:01:10 +0000 (02:01 +0200)]
rgw_user.cc: cleanup RGWAccessKeyPool::check_op()
Remove dead assignment and unsued variable 'secret_key'. Check
op_state.get_access_key() directly for emptiness without extra
variable. Fix comment above check for access key.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
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>
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>
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>
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>
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>
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>
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>
Sage Weil [Thu, 8 May 2014 17:42:42 +0000 (10:42 -0700)]
mon/OSDMonitor: force op resend when pool overlay changes
If a client is sending a sequence of ops (say, a, b, c, d) and partway
through that sequence it receives an OSDMap update that changes the
overlay, the ops will get send to different pools, and the replies will
come back completely out of order.
To fix this, force a resend of all outstanding ops any time the overlay
changes.
Fixes: #8305 Signed-off-by: Sage Weil <sage@inktank.com>
Sage Weil [Thu, 8 May 2014 17:52:11 +0000 (10:52 -0700)]
osdc/Objecter: resend ops in the last_force_op_resend epoch
If we are a client, and process a map that sets last_force_op_resend to
the current epoch, force a resend of this op.
If the OSD expects us to do this, it will discard our previous op. If the
OSD is old, it will process the old one, this will appear as a dup, and we
are no worse off than before.
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>
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>
Sage Weil [Fri, 24 May 2013 00:12:27 +0000 (17:12 -0700)]
client: invalidate dentry leases when unlinking
In many case when we are unlinking inodes we also need to invalidate the
dentry lease, as we are not promised that the dentry is NULL. Be a bit
over-conservative here for good measure.
Signed-off-by: Sage Weil <sage@inktank.com> Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
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>
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.
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.
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>
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>
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>
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>
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>