Add krbd mode support (-K) to test krbd in the same way librbd is
tested. This introduces a dependency on libkrbd and, because it's
a C++ static library, requires C++ linking. The rbd_operations
framework can be extended in the future to also test rbd_fuse.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
In preparation for krbd mode support, introduce an option to disable
randomized striping. The kernel as of 3.15 does not support "fancy"
striping and will not map images with non-default striping values.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
In preparation for krbd mode support, provide an option to specify
alignment for discards. The kernel will reject discard requests whose
offset and length are not sector-size aligned.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
In preparation for krbd mode support, change check_trunc_hack() to
resize to a sector-size aligned value. The kernel will not work with
images whose size is not sector-size aligned.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Use posix_memalign() to allocate good_buf and temp_buf, which must be
writebdy and readbdy aligned respectively. Using round_ptr_up() the
way it is used makes fsx crash on free()s at the end of main(), because
the pointer returned by malloc() is overwritten by the aligned pointer.
Drop round_ptr_up() as it is no longer used.
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
fast dispatch
This series adds an ms_fast_dispatch interface to the Messenger/Dispatcher, designed so that you can dispatch messages directly from the Pipe threads without going through the Dispatch queue.
It also sets the OSD to make use of this interface for most operations, and switches to finer-grained locking and use of local data in a bunch of different paths to enable that.
Reviewed-by: Samuel Just <sam.just@inktank.com>
The insert_trace() logic is about managing local cache consistency; the
verify_reply_trace() is about retrying requests to get the results that
our callers need.
Set up stubs to handle rmdir and unlink while we are here.
Signed-off-by: Sage Weil <sage@inktank.com>
MetaRequests may have references to these dentries. Instead of removing
them and tearing down the directory, just unlink them from the inodes.
We could be a bit smarter here if we looked at the reference count, but
this works too.
Signed-off-by: Sage Weil <sage@inktank.com>
In case we hit issue #8269 we'd like to avoid creating an old style
manifest. Since we need to have parts that use different prefix we add a
new rule param that overrides the manifest prefix.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Fixes: #8299
Backport: firefly
The stripe size calculation was broken, specifically affected cases
where we had manifest that described multiple parts.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
handle following sequence of events:
- subtree becomes frozen, C_MDC_ExportFreeze is queued.
- export is cancelled
- C_MDC_ExportFreeze is executed.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
When splitting dirfrag, delta rstat is always added to the first new
dirfrag. Ancestors of the dirfrag may have nagtive rstat before the
delta rstat has been propagated to them. For example:
inode 100 n(v1 b-4096)
|- dir 100 n(v1 b-4096)
|- dentry
|- inode 101 n(v1 b-4096)
|- dir 101.0* n(v1)/n(v1 b-4096)
|- dir 101.1* n(v1)
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
when cluster is degraded, acquiring locking can take long time.
It is not good to keep dirfrags in frozen state for a long time.
To allow cancelling fragment operation at any time, this commit
also reorganizes the codes that freeze/fetch dirfrags.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Makes sure recovering MDS get uptodate fragstat/rstat for subtree root
dirfrags. it's required the codes that fix-up inode's fragstat/rstat.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
There is a special case that the MDRequest needs to be preserved after
rolling back slave rename. The preserved MDRequest will be used later.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>