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: return error if we specified a wrong image name for rbd du #11031
Conversation
@@ -206,6 +208,10 @@ static int do_disk_usage(librbd::RBD &rbd, librados::IoCtx &io_ctx, | |||
++count; | |||
} | |||
} | |||
if (!found) { | |||
std::cerr << "specified image of " << imgname << "is not found." << std::endl; | |||
return -EINVAL; |
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.
-ENOENT?
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.
Good suggestion
@@ -206,6 +208,10 @@ static int do_disk_usage(librbd::RBD &rbd, librados::IoCtx &io_ctx, | |||
++count; | |||
} | |||
} | |||
if (!found) { | |||
std::cerr << "specified image of " << imgname << "is not found." << std::endl; |
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.
Minor: remove "of" and add extra space before "is not found".
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.
Okey
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.
@dillaman this is already updated, but I am not sure why it's still expanded here in github.
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
lgtm |
Fixes: http://tracker.ceph.com/issues/16987
Signed-off-by: Dongsheng Yang dongsheng.yang@easystack.cn