The whitespace for the current pretty mode is awkward and weird. Move
to a more standard approach. It's more newlines, but *much* more
readable.
Signed-off-by: Sage Weil <sage@redhat.com>
Previously was set in hashbang, which meant
that "./quota.sh" was OK, but "sh ./quota.sh" would
just run through ignoring errors.
Signed-off-by: John Spray <john.spray@redhat.com>
The existing ceph_test_librbd integration tests are now used
within unittest_librbd as unit tests run during 'make check'.
The unit tests use librados_test_stub to simulate RADOS.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new librados_test_stub library can be used by unit tests
as a replacement for the librados shared library. The library
currently provides an in-memory RADOS simulator and will
allow future unit tests to be developed using mocking.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
FunctionContext uses boost::function to allow the Context
interface to invoke arbitrary functions. This eliminates
the need to create derived Context classes for every use
case.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When set min_size value:
A:for replicated pool, the value must be between in 1 and size
B:for erasure pool, the value must be between in data_chunk_count)
and size(data_chunk_count + code_chunk_count).
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
AIO requests that are waiting on the image lock should be flushed
during all existing RBD flush scenarios. A few flush cases were
missed in the original implementation.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new RBD exclusive lock feature should be treated as a
feature that is only applied when the image is opened in
R/W mode.
Older clients will need to handle the updated
cls_rbd::get_features method in order to properly determine
the incompatible features for an image depending on the
current mode.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The new unit tests cover the modifications made to integrate
the internal librbd functionality with the new ImageWatcher.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Directly unit test the new ImageWatcher class to complement
the existing librbd integration tests of exclusive lock
handling.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Unit tests need access to the private symbols of librbd no
longer exported from librbd.so. A new librbd_internal
convenience library was created to allow access.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Operations that update the image now require the exclusive lock
if the feature is enabled. AIO write and discard operations will
automatically request the exclusive lock from the current leader
to support live-migration.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
As a follow-on to 49d114f1ff,
increment the "extra" version field so clients can easily
determine if they have a version of librados that properly
translates C API operation flags.
Signed-off-by: Matthew Richards <mattjrichards@gmail.com>
The new watch/notify handler replaces the existing header
update watch/notify handler and adds support for managing
image exclusive lock leadership.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Note that this will only get used if the kernel is new enough; if it is
older than 3.5 the option will get disabled and extsize will not be used
even if the option is set to true.
This partially reverts 01cd3cdc72.
Fixes: #9956
Signed-off-by: Sage Weil <sage@redhat.com>
Old kernels have an XFS bug that exposes uninitialized data when the
extsize hint is set and only partially written. This is fixed by Linux
commit aff3a9edb7080f69f07fe76a8bd089b3dfa4cb5d, documented in XFS bug
http://oss.sgi.com/bugzilla/show_bug.cgi?id=874, and tested by XFS
test xfs/229 to prevent regressions.
Notably the original bug affects kernel 3.2, which is widely deployed with
ubuntu precise 12.04.
Backport: giant, firefly
Signed-off-by: Sage Weil <sage@redhat.com>
This is for use in CephFS disaster recovery. When
the metadata pool has been forcibly reset to a single-MDS
metadata tree, we would like to reset the MDSMap to match.
Signed-off-by: John Spray <john.spray@redhat.com>
Note: It does not do the merging work if
either of the source diff files is stripped,
since which complicates the process and is
rarely used
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: MingXin Liu <mingxinliu@ubuntukylin.com>
Reviewed-by: Li Wang <liwang@ubuntukylin.com>
Signed-off-by: MingXin Liu <mingxinliu@ubuntukylin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Reviewed-by: Li Wang <liwang@ubuntukylin.com>
Signed-off-by: MingXin Liu <mingxinliu@ubuntukylin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Reviewed-by: Li Wang <liwang@ubuntukylin.com>
Avoid taking the PG lock for a canceled read op (if we are lucky). Recheck
after the lock is taken for good measure.
Signed-off-by: Sage Weil <sage@redhat.com>
We can't use the synchronous completion callbacks (in fast dispatch
context) do to the proxy read completion work.
Signed-off-by: Sage Weil <sage@redhat.com>