Gregory Farnum [Thu, 16 Oct 2014 13:57:34 +0000 (06:57 -0700)]
Merge pull request #2628 from ceph/wip-client-flock
Wip client flock
Add support for file locking to the userspace client, and improve blocked-lock cancellation so that it doesn't remove locks that succeeded when racing.
Loic Dachary [Thu, 16 Oct 2014 00:14:53 +0000 (17:14 -0700)]
mon: add the osd crush rename-bucket command
The synopsis is:
osd crush rename-bucket name1 name2
It is made idempotent by interpreting -EALREADY as returned by
CrushWrapper::rename_bucket return as success.
The crush_rename_bucket method first checks for errors with
CrushWrapper::can_rename_bucket if there is no pending crush so that it
can return early and avoid the creation of a pending crush map.
If renaming is possible, CrushWrapper::rename_bucket is called on the
pending crush map (and creates it indirectly if it does not already
exists).
Loic Dachary [Thu, 16 Oct 2014 00:06:12 +0000 (17:06 -0700)]
crush: add CrushWrapper::rename_item and can_rename_item
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.
Loic Dachary [Thu, 16 Oct 2014 00:02:58 +0000 (17:02 -0700)]
crush: improve constness of CrushWrapper methods
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.
Jason Dillaman [Tue, 14 Oct 2014 15:09:09 +0000 (11:09 -0400)]
librbdpy: Added missing method docstrings
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>
Yan, Zheng [Mon, 13 Oct 2014 03:34:18 +0000 (11:34 +0800)]
client: use finisher to abort MDS request
When a request is interrupted, libfuse first locks an internal mutex,
then calls the interrupt callback. libfuse need to lock the same mutex
when unregistering interrupt callback. We unregister interrupt callback
while client_lock is locked, so we can't acquiring the client_lock in
the interrupt callback.
This commit introduce two new types of setfilelock request. Unlike
setfilelock (UNLOCK) request, these two new types of setfilelock request
do not drop locks that have alread been acquired, they only interrupt
blocked setfilelock request.
Yan, Zheng [Thu, 9 Oct 2014 01:42:08 +0000 (09:42 +0800)]
client: register callback for fuse interrupt
libfuse allows program to reigster a callback for interrupt. When a file
system operation is interrupted, the fuse kernel driver sends interupt
request to libfuse. libfuse calls the interrupt callback when receiving
interrupt request.
Jianpeng Ma [Mon, 13 Oct 2014 05:33:38 +0000 (13:33 +0800)]
FileStore:Round offset of fiemap down aligned with CEPH_PAGE_SIZE.
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>
BJ Lougee [Sat, 11 Oct 2014 07:44:17 +0000 (02:44 -0500)]
libcephfs.h libcephfs.cc : Defined error codes for the mount function
Used new error codes from libcephfs.h to replace the magic numbers in the mount functon found in libcephfs.cc.
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>
Yehuda Sadeh [Thu, 9 Oct 2014 17:20:27 +0000 (10:20 -0700)]
rgw: set length for keystone token validation request
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>
Greg Farnum [Thu, 9 Oct 2014 16:47:29 +0000 (09:47 -0700)]
client: print out mode, uid, gid if they are changed
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.
In case of strncpy() make sure string is '\0' terminated. Before
usage of strcat() check if the destination has enough free space
to concat the char and to terminate the string to prevent illegal
memory access.
Fix for:
CID 1219459 (2 of 2): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument of
1024 bytes on destination array goodfile of size 1024 bytes might
leave the destination string unterminated.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Thu, 2 Oct 2014 08:48:25 +0000 (10:48 +0200)]
mount.ceph.c: ensure '\0' terminated string
Reserve last char in array for '\0' to ensure termination
of the string.
Fix for:
CID 1128383 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument
of 1000 bytes on destination array secret of size 1000 bytes might
leave the destination string unterminated.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Loic Dachary [Wed, 8 Oct 2014 14:27:47 +0000 (16:27 +0200)]
qa: move mon_mds tests last
Assuming they are more likely than others to leave OSD/MON in an
unstable state that could have undefined side effects on the tests
following it. A cleaner solution would be to run them in a separate
script that is run on an independent cluster.