We can't just call rados->finalize_watch() and rados->init_watch() from
the watcher, as these calls modify the watcher itself. Also, we can't just
enable the cache after successful watch, because there's more than one
watcher. Only enable the cache if all watchers are set.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Note that we don't really use it fully, yet. The main semantic change
here is that we have to explicitly ack the notify.
However, still missing is re-registration of the watch if we see a failure,
and ignoring the cache if watch_check tells us the watch is stale.
Signed-off-by: Sage Weil <sage@redhat.com>
In Debian, the ceph-test package can be installed with any version of
ceph-common.
Prior to this commit, in RHEL, we're much more strict about which
version of the dependencies we require. We depend directly on
librados2/librbd1/libcephfs1 instead of ceph-common, and we also require
the specific versions of these libraries to match the version of
ceph-test.
For testing Ceph, it is nice to have the ability to upgrade the
librados2/librbd1/libcephfs1 libraries on a host without having to also
upgrade the ceph-test package as well.
Remove the version number requirements, and change the dependencies from
librados2/librbd1/libcephfs1 to simply "ceph-common". That will make
/etc/ceph/ and /var/log/ceph present for the tests.
http://tracker.ceph.com/issues/10989 Refs: #10989
Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
(cherry picked from commit 924f85f157)
If the object map is enabled, it's possible for a read request to
instantly complete due to the skipped librados operations. Now
AioRequest will block the completion of read_from_parent requests
to prevent the possibility of the parent image being closed while
the read_from_parent method invocation is in-progress.
Fixes: #10968
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Blocked AioCompletions will not fire their callback until unblocked.
This is an expansion / replacement of the previous 'building' flag
used to block completions while additional requests were added to the
completion.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
If an object map update is not required when modifying an image,
properly free the memory allocated for the callback Context.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
AioRead and CopyupRequest were not properly handling possible
error codes from aio_read. They now correctly free the completion
and invoke the callback context.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The crushtool is aborted if it takes more than mon lease seconds. Since
the monitor blocks while running it, this is mandatory otherwise the
monitor will be considered down and new elections triggered.
http://tracker.ceph.com/issues/10947Fixes: #10947
Signed-off-by: Loic Dachary <ldachary@redhat.com>
Make crushtool a configuration value that defaults to crushtool and
allow it to be injected. It helps with testing: the command can be
replaced with another that misbehaves in various ways.
Signed-off-by: Loic Dachary <loic@dachary.org>
rbd CLI now includes rbd image flags and no longer defaults
to enabling the new exclusive locking feature.
Fixes: #10962
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
rbd did not previously support specifying striping params
for cloned and imported images. Extend the behavior to
these other CLI commands.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
All feature flags were being displayed when using JSON/XML
formatted output. Now use the same formatting routing for
plain/JSON/XML output for features and flags.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
If the exclusive lock feature is enabled, all locks need
to be removed prior removing the image.
Fixes: #10990
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
There was a potential race condition between a delayed AIO
operation waiting on acquiring a lock and a snap_create
flushing all pending IO. Since snap_create owned md_lock, the
delayed AIO would not be allowed to complete -- deadlocking the
flush.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
In the case where concurrent IO is occurring when a trim resize
operation is initiated, hold the snap_lock between clipping the
IO operation and registering the pending op. That allows the
resize state machine to properly flush all operations issued
before the clip region was updated.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The --output-csv option to crushtool will create files in the current
directory of the monitor. The only reason for using it is because
crushtool requires at least one option for display. Relax this
constraint in crushtool and remove the option from the call made by the
monitor to validate a new crushmap.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
Keep async_resize truly async by moving flush and invalidate cache
operations to individual states within the resize state machine.
Fixes: #10958
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Break the existing synchronous behavior into pre- and post-
flush routines using the existing logic.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Most of the ceph tree is LGPLv2.1, but there are some files that are
under the full GPLv2.
Add a copy of the GNU General Public License (version 2) to the
distribution. This file was copied verbatim from
https://www.gnu.org/licenses/gpl-2.0.txt
Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
Unlike the other Context derived classes, C_SaferCond is not
a suicidal object which deletes itself. Swap heap allocations
of C_SaferCond to stack-based allocations as a result.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
We identify the Linux kernel version and based on that either expect to
be able to invalidate dentries effectively, or expect to be able to remount
the ceph-fuse mountpoint. Test it using the Client functions and callbacks by
spinning off a thread to invoke the test that is separate from the main
FUSE loop.
Most unfortunately, there doesn't seem to be a good interface to tell
FUSE to shut down if we need to do that. See
http://fuse.996288.n3.nabble.com/libfuse-exiting-fuse-session-loop-td10686.html
I tried changing our signal invocation or attempting a simple action on
the mount point but those were ineffectual at terminating the remaining
processes; fusermount actually gets rid of them all.
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
This brings back a few small code chunks that were removed in
0827bb79ea. We check the kernel version,
and if it is less than 3.18 we use these dentry invalidation callbacks
instead of the remount callback. This should resolve a number of
issues with racing against remount, including #10916, and lets older
unprivileged users on older kernels run even if they can't apply
options on mount (#10542).
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
Unprivileged users can't use options when remounting; see
http://tracker.ceph.com/issues/10542. We're about to use this
in ceph-fuse when starting up.
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
The rbd CLI now utilizes the rbd_default_format configuration
setting, therefore the copy test now needs to tell rbd which image
format it is expecting to create.
Fixes: #10961
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
After commit 419800fe (client: re-send request when MDS enters reconnecting
stage), cephfs client can send both unsafe requests and normal requests when
MDS is in reconnecting stage. Normal requests can have embedded cap releases,
the client code encodes these embedded cap releases after composing the cap
reconnect message. This causes the client sliently drop some caps. The fix
is re-send requsets (which add embedded cap releases) before composing the
cap reconnect message
Fixes: #10912
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 8ea5a811b3)