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

rbd: error out if import image format failed #13957

Merged
merged 1 commit into from Apr 6, 2017

Conversation

Projects
None yet
2 participants
@wangzhengyong
Contributor

wangzhengyong commented Mar 14, 2017

@@ -752,6 +752,10 @@ static int do_import(librbd::RBD &rbd, librados::IoCtx& io_ctx,
} else {
r = do_import_v2(fd, image, size, imgblklen, pc);
}
if (r < 0) {
std::cerr << "rbd: failed to import image format" << std::endl;
goto err;

This comment has been minimized.

@dillaman

dillaman Mar 15, 2017

Contributor

You would need to let this fall through to ensure the image is properly closed

This comment has been minimized.

@wangzhengyong

wangzhengyong Mar 16, 2017

Contributor

i forget this...

@@ -752,6 +752,10 @@ static int do_import(librbd::RBD &rbd, librados::IoCtx& io_ctx,
} else {
r = do_import_v2(fd, image, size, imgblklen, pc);
}
if (r < 0) {
std::cerr << "rbd: failed to import image format" << std::endl;

This comment has been minimized.

@dillaman

dillaman Mar 15, 2017

Contributor

Nit: I would drop "format" at the end of the sentence

rbd: error out if import image format failed
Signed-off-by: wangzhengyong@cmss.chinamobile.com
if (r < 0) {
std::cerr << "rbd: failed to import image" << std::endl;
image.close();
goto err;

This comment has been minimized.

@dillaman

dillaman Mar 16, 2017

Contributor

Nit: still need to close the image

@dillaman dillaman added the needs-qa label Mar 27, 2017

@dillaman dillaman merged commit 184df4a into ceph:master Apr 6, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment