Skip to content
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

Merged
merged 1 commit into from
Nov 5, 2015

Conversation

xinxinsh
Copy link

Fixes: #13558

Signed-off-by: xinxin shu xinxin.shu@intel.com

@xinxinsh
Copy link
Author

xinxinsh commented Nov 2, 2015

@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) {
Copy link

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);
Copy link

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>
@xinxinsh
Copy link
Author

xinxinsh commented Nov 5, 2015

@dillaman , updated, help review

@dillaman
Copy link

dillaman commented Nov 5, 2015

lgtm

dillaman pushed a commit that referenced this pull request Nov 5, 2015
librbd : fix enable objectmap feature issue

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
@dillaman dillaman merged commit 72a9fb4 into ceph:master Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants