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>
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>
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>
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>
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>
Otherwise, redirected ops will suddenly have a different tid
and will become uncancelable.
Fixes: #7588
Signed-off-by: Samuel Just <sam.just@inktank.com>
We call start_flush() with a NULL op in a couple different places. Do not
put a NULL pointer on the dup_ops list or we will crash later.
Fixes: #8328
Signed-off-by: Sage Weil <sage@inktank.com>
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>
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>
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>
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>
If an op is sent before last_force_op_resend, and the client's feature is
present, drop the op because we know they will resend.
Signed-off-by: Sage Weil <sage@inktank.com>
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.
Signed-off-by: Sage Weil <sage@inktank.com>
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>
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>
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>
Basically, always keep the dentry and dir, unless we are pruning.
Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
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>
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>
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>