bufferlist a;
a.append("A");
bufferlist ab;
ab.append("AB");
a >= ab failed, throwing an instance of 'ceph::buffer::end_of_buffer'
because it tried to access a[1]. All comparison operators should be
tested using a lexicographic sort like strcmp or memcmp (-1, 0, 1).
In the meantime, the missing test is added:
if (l.length() == p && r.length() > p) return false;
A set of unit tests demonstrating the problem and covering all comparison
operators are added to show that the proposed fix works as expected.
http://tracker.ceph.com/issues/4157 refs #4157
Signed-off-by: Loic Dachary <loic@dachary.org>
Automatically map encrypted journal partitions.
For encrypted OSD partitions, map them, wait for the mapped device to
appear, and then ceph-disk-activate.
This is much simpler than doing the work in ceph-disk-activate.
Signed-off-by: Sage Weil <sage@inktank.com>
Keep keys in /etc/ceph/dmcrypt-keys.
Identify partition instances by the partition UUID. Identify encrypted
partitions by a parallel set of type UUIDs.
Signed-off-by: Alexandre Marangone <alexandre.maragone@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
This is fugly, but sudo -E doesn't work. Fix this after we are installing
debs and the path doesn't matter anymore!
Signed-off-by: Sage Weil <sage@inktank.com>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
warning from cppchecker was:
[src/cls/lock/cls_lock.cc:209]: (performance) Possible inefficient
checking for 'lockers' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
warning from cppchecker was:
[src/client/SyntheticClient.cc:2706]: (performance) Possible
inefficient checking for 'subdirs' emptiness
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
warning from cppchecker was:
[src/client/Client.cc:3649]: (performance) Possible inefficient
checking for 'mds_sessions' emptiness.
[src/client/Client.cc:7489]: (performance) Possible inefficient
checking for 'osds' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
warning from cppchecker was:
[src/mds/MDSMap.h:448]: (performance) Possible inefficient
checking for 'up' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
warning from cppchecker was:
[src/mds/CDentry.h:234]: (performance) Possible inefficient
checking for 'projected' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
warning from cppchecker was:
[src/ceph_authtool.cc:124]: (performance) Possible inefficient
checking for 'caps' emptiness.
[src/ceph_authtool.cc:237]: (performance) Possible inefficient
checking for 'caps' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
It's still not clear to end users this should go into the
mon or global section of ceph.conf
Until this gets resolved document it here as well for the people
who look up their settings in the source code.
Signed-off-by: Wido den Hollander <wido@42on.com>
Add error handling for open(), posix_memalign() and malloc().
Reuse code for read_* and write_* functions.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
The example was out of date. Adding a note about how to look at the request
queue on the OSD.
Reported-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Sage Weil <sage@inktank.com>
Newer versions of spirit (1.49.0-3.1ubuntu1.1 in quantal, in particular)
dislike the construct with alnum and replace the - and _ with '\0' in the
resulting string.
Fixes: #4122
Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
We should always handle_activate_map() after handle_advance_map() in
order to kick the pg into a valid peering state for processing requests
prior to dropping the lock.
Additionally, we would prefer to avoid sending irrelevant messages
during boot, so only send if we are up according to the current service
osdmap.
Fixes: #4064
Backport: bobtail
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
'rgw socket path' overrides 'rgw port'.
An 'rgw host' can be set to listen on a specific ip (default is 0.0.0.0)
Signed-off-by: Guilhem Lettron <guilhem.lettron@youscribe.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Fix some smaller performance related issues from cppcheck due to
"Variable '..xy..' is reassigned a value before the old one has been used.
Fix some indention.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() instead of 'size() == 0' or 'size() < 1' to check
for emptiness for performance reasons.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>