-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librbd : fix enable objectmap feature issue #6339
Conversation
@dillaman , pls help review |
@@ -1564,6 +1582,11 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type, | |||
lderr(cct) << "cannot enable object map" << dendl; | |||
return -EINVAL; | |||
} | |||
if ((ictx->features & RBD_FEATURE_OBJECT_MAP) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would create the object map after the feature bits have been updated on disk (just in case the feature bit update fails). I would also create an object map for each existing snapshot to avoid similar "failed to load object map" errors when opening a snapshot.
@@ -1575,13 +1605,6 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type, | |||
enable_flags |= RBD_FLAG_FAST_DIFF_INVALID; | |||
features_mask |= (RBD_FEATURE_OBJECT_MAP | RBD_FEATURE_EXCLUSIVE_LOCK); | |||
} | |||
|
|||
if (enable_flags != 0) { | |||
r = update_all_flags(ictx, enable_flags, enable_flags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't move this down -- we want to flag the object map as invalid before anyone gets a chance to use it.
Fixes: ceph#13558 Signed-off-by: xinxin shu <xinxin.shu@intel.com>
@dillaman , updated, help review |
lgtm |
librbd : fix enable objectmap feature issue Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Fixes: #13558
Signed-off-by: xinxin shu xinxin.shu@intel.com