Rename a bucket and return -ENOTDIR if trying to rename an item. The
behavior is otherwise the same as rename_item and can_rename_item.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
The can_rename_item is a const method checking if renaming an item could
succeed. If not it returns a unique -errno code and a human readable
message message.
Trying to rename a non existent item into an existent item returns
-EALREADY which can be treated as success if renaming is to be
idempotent.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
A number of CrushWrapper get methods or predicates were not const
because they need to maintain transparently the rmaps. Make the rmaps
mutable and update the constness of the methods to match what the caller
would expect.
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Several methods were missing docstrings, preventing the methods
from appearing in the generated documentation. Ensured all methods
now have appropriate docstrings.
Fixes: 5977
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
There is a bug on xfs about fiemap. If offset unsigned, the result of
fiemap will leak some data.
Kernel commit eedf32bfcace7d8e20cc66757d74fc68f3439ff7 fix this bug.
To avoid this bug on kernel which don't apply this commit, in ceph we
make the offset down aligned with CEPH_PAGE_SIZE.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
The || instead of && had it always installed. That was fixed in EPEL
already.
http://tracker.ceph.com/issues/9747Fixes: #9747
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Used new error codes from libcephfs.h to replace the magic numbers in the mount functon found in libcephfs.cc.
Signed-off-by: BJ Lougee <almightybeeij@gmail.com>
Since the option '--format' for specifying the rbd image format is
deprecated, we should recommend '--image-format' instead.
Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
Make sure k and m paramter are valid to prevent crash. Fix typo.
Fix for the following CID and other possible invalid combinations
of k/m parameter:
CID 1219466 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression rand() % (k + m), modulo by expression
k + m which may be zero has undefined behavior.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fixes: #7796
Backport: giany, firefly
Need to set content length to this request, as the server might not
handle a chunked request (even though we don't send anything).
Tested-by: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Many integers were parsed with functions that silently ignored junk at
the end of the string. Extra characters now cause errors.
Fixes: 8983
Signed-off-by: Adam Crume <adamcrume@gmail.com>
These values can be printed by MClientRequest message output, but if
they're flushed out via cap updates we don't even get that. These
are important values that generally don't change often; so print
them out in debug logging.
Signed-off-by: Greg Farnum <greg@inktank.com>
Refactor code to use calloc() instead of malloc() to make
sure the char* TEST_BUCKET_OBJECT_SIZE memory is set to
zero before call put_bucket_obj().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:
CID 1054876 (#1 of 1): Use after free (USE_AFTER_FREE)
pass_freed_arg: Passing freed pointer bucket_obj as an
argument to put_bucket_obj
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Release completion as soon as no longer needed.
Fix for:
CID 1219593 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable completion going out of scope
leaks the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>