Setting this option to false reverts librbd to legacy behavior
where AIO operations could potentially block.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
The profile stored by the plugin may be different from the one set by
the user: it includes defaults. When the plugin is initialized, the
profile is modified to include the default values. Verify that the
modified profile matches what the get_profile() method returns, to guard
against inconsistencies from the erasure code plugin implementation.
http://tracker.ceph.com/issues/11663Fixes: #11663
Signed-off-by: Loic Dachary <ldachary@redhat.com>
An erasure-code profile set by the user may be modified by the erasure
code plugin, most of the time to add default values for domain failure,
techniques etc.
Whenever the monitor gets an erasure code profile from the user or the
configuration file, it uses it to initialize the corresponding erasure
code plugin and:
* validate the profile and get an error if it is invalid
* get a normalized profile
The normalized profile is stored in the OSDMap. Should the user try
to set the same erasure code profile with the different values that lead
to the same normalized form, the modification will be accepted as a
noop, as if the same values were given. For instance:
ceph osd erasure-code-profile set myprofile k=2
ceph osd erasure-code-profile set myprofile k=2 m=1
are the same because the default value for m is 1 for the default
jerasure plugin.
If the normalized form is not used for storage and comparison, the
second call with m=1 will fail and require --force to override
myprofile, although the user can read from the documentation that it
matches the default value.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
The ErasureCode::init function is implemented to store the profile and
is called by the init method of each plugin. The
ErasureCode::get_profile function is implemented to return the profile
that was stored. A specialized ostream<< function is implemented to
facilitate the display of the profile.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
Add the get_profile method to the interface and make it a pure virtual.
Each plugin is expected to return the profile currently in use. Although
the profile is also stored in the OSDMap, it provides a convenient
introspection method to validate that the profile being set is indeed
the profile being used.
Signed-off-by: Loic Dachary <ldachary@redhat.com>
RPM spec files summary should not end with a dot.
This was inconsistent across the ceph rpm packages
and creates errors with rpm lint.
Signed-off-by: Owen Synge <osynge@suse.com>
1. Creating a filesystem using a
readonly tier on an EC pool (should be forbidden)
2. Removing a tier from a replicated base pool (should
be permitted)
Signed-off-by: John Spray <john.spray@redhat.com>
For EC pools, we need a tier that is not just forwarding
writes, in order to provide the ops required
by CephFS.
Signed-off-by: John Spray <john.spray@redhat.com>
CInode::pop_projected_snaprealm() was called after calling
CDentry::pop_projected_linkage(). So get_parent_inode()->find_snaprealm()
is not past parent snaprealm. The fix is set snaprealm->open to 'false'
and let SnapRealm::_open_parents() open the new past parent.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
make sure snaprealm's parents are opened before building
cached_snaps/cached_snap_context/cached_snap_trace
Signed-off-by: Yan, Zheng <zyan@redhat.com>
getnum() returns an integer while maxfilelen is a unsinged long.
Use a temp var to be able to check the result of the call.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Don't check for the conditions used inside get_projected_parent_dn(),
simply check if the returned value is valid.
Fix for:
CID 716915: Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointer this->get_projected_parent_dn()
to pre_dirty, which dereferences it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:
CID 1232599: Bad bit shift operation (BAD_SHIFT)
negative_shift: In expression i << (4 - split_bits) % 4, shifting by
a negative amount has undefined behavior. The shift amount,
(4 - split_bits) % 4, is -1.
CID 1232600: Bad bit shift operation (BAD_SHIFT)
negative_shift: In expression 1 << pg_num_bits - 1, shifting by a
negative amount has undefined behavior. The shift amount,
pg_num_bits - 1, is -1.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1058792 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
fixed_size_dest: You might overrun the 4097 byte fixed-size string
cname by copying &pde->d_name[8UL] - 1 without checking the length.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1296375 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument of
1024 bytes on destination array logfile of size 1024 bytes might leave
the destination string unterminated.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717135 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
1. format_changed: precision changes the format state of std::cout for
category precision.
4. end_of_path: Changing format state of stream std::cout for category
precision without later restoring it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717134 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
4. format_changed: precision changes the format state of std::cout
for category precision.
26. end_of_path: Changing format state of stream std::cout for category
precision without later restoring it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717133 (#1 of 1): Not restoring ostream format (STREAM_FORMAT_STATE)
95. format_changed: fill changes the format state of std::cout for
category fill.
100. end_of_path: Changing format state of stream std::cout for
category fill without later restoring it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Suppress coverity issue:
CID 1193085 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: This case (value -114) is not terminated by a
'break' statement.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for coverity issue caused by 8811df3 (introduced a similar
check some lines earlier in the code causing the check to return
earlier).
at_least: At condition r < 0, the value of r must be at least 0.
dead_error_condition: The condition r < 0 cannot be true.
CID 1274289 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Silence coverity: ls.empty() check should already imply that
ls.size() != 0.
CID 1295402 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression rand() % ls.size(), modulo by
expression ls.size() which may be zero has undefined behavior.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:
CID 1295405 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable req_comp going out of scope leaks
the storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
A get/set command may fail with
Error EBUSY: currently creating pgs, wait
if issued before the PGs are clean. Call wait_for_clean after the pool
is created or a pool setting is changed and remaps the PGs it
contains (size, pg_num...) to ensure the PGs are clean and the set/get
command that follow will succeed.
http://tracker.ceph.com/issues/11624Fixes: #11624
Signed-off-by: Loic Dachary <ldachary@redhat.com>
The semantic and interface of get_pg are the same, that avoids
duplication and the ceph-helpers.sh version is tested and documented.
Make the ceph-test package dependent on xmlstarlet because it is
needed by ceph-helpers.sh.
Signed-off-by: Loic Dachary <ldachary@redhat.com>