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: retrieve image name when opening by id #7736

Merged
merged 3 commits into from Feb 24, 2016

Conversation

trociny
Copy link
Contributor

@trociny trociny commented Feb 22, 2016

name is empty when the image is opened by its id.

Signed-off-by: Mykola Golub mgolub@mirantis.com

@dillaman
Copy link

@trociny Should we just fix the issue that name isn't populated when opening by ID? We can add a new state to the image::RefreshRequest state machine to invoke the dir_get_name class method.

@trociny
Copy link
Contributor Author

trociny commented Feb 22, 2016

@dillaman

Should we just fix the issue that name isn't populated when opening by ID? We can add a new state to the image::RefreshRequest state machine to invoke the dir_get_name class method.

Ok, will try this way. Thanks.

@trociny
Copy link
Contributor Author

trociny commented Feb 23, 2016

@dillaman I have made the name to be populated when opening by ID.

Unfortunately it does not help for the initial issue, because asok is created earlier, on ImageCtx creation, before open. Do you know any hook I could use to create/delete asok on image open/close, instead of on image context construction/deletion?

@trociny
Copy link
Contributor Author

trociny commented Feb 23, 2016

@dillaman The same issue (empty name) is for perf name, which is initialized in ImageCtx::init().

@dillaman
Copy link

Actually, image::OpenRequest is probably a better state machine since we only need to load the name once. ImageCtx::init should be invoked near the end of the refresh state machine, so as long as you load the name before you start the refresh, that should work. As for the ASOK, can't we just delay it until ImageCtx::init?

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
@trociny trociny changed the title librbd: use image ID in asok commands if name is empty librbd: make ImageCtx name field be populated when opening by ID Feb 24, 2016
@trociny
Copy link
Contributor Author

trociny commented Feb 24, 2016

@dillaman rebased after applying your suggestions.

@dillaman dillaman self-assigned this Feb 24, 2016

if (*result == 0) {
bufferlist::iterator it = m_out_bl.begin();
cls_client::dir_get_name_finish(&it, &m_image_ctx->name);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*result = cls_client::dir_get_name_finish ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Fixed.

Mykola Golub added 2 commits February 24, 2016 16:28
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
@dillaman dillaman changed the title librbd: make ImageCtx name field be populated when opening by ID librbd: retrieve image name when opening by id Feb 24, 2016
dillaman pushed a commit that referenced this pull request Feb 24, 2016
librbd: retrieve image name when opening by id

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
@dillaman dillaman merged commit 53d87e1 into ceph:master Feb 24, 2016
@trociny trociny deleted the fix-librbd-asok-empty-name branch March 14, 2016 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants