return -EINVAL;
}
+ bool use_p_features = true;
uint64_t features;
- if (c_opts.get(RBD_IMAGE_OPTION_FEATURES, &features) != 0) {
+ if (c_opts.get(RBD_IMAGE_OPTION_FEATURES, &features) == 0) {
if (features & ~RBD_FEATURES_ALL) {
lderr(cct) << "librbd does not support requested features" << dendl;
return -ENOSYS;
}
+ use_p_features = false;
}
// make sure child doesn't already exist, in either format
r = -ENOSYS;
goto err_close_parent;
}
-
+
if (r < 0) {
// we lost the race with snap removal?
lderr(cct) << "unable to locate parent's snapshot" << dendl;
goto err_close_parent;
}
+ if (use_p_features) {
+ c_opts.set(RBD_IMAGE_OPTION_FEATURES, p_features);
+ }
+
order = p_imctx->order;
if (c_opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0) {
c_opts.set(RBD_IMAGE_OPTION_ORDER, order);