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/11663 Fixes: #11663
Signed-off-by: Loic Dachary <ldachary@redhat.com>
}
}
- return plugin->factory(profile, erasure_code, ss);
+ int r = plugin->factory(profile, erasure_code, ss);
+ if (r)
+ return r;
+ if (profile != (*erasure_code)->get_profile()) {
+ *ss << __func__ << " profile " << profile << " != get_profile() "
+ << (*erasure_code)->get_profile() << std::endl;
+ return -EINVAL;
+ }
+ return 0;
}
static const char *an_older_version() {