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 snap_exists API return code overflow #6986

Merged
merged 3 commits into from Dec 21, 2015

Conversation

xiexingguo
Copy link
Member

@xiexingguo xiexingguo changed the title 礼拜日本的: librbd: fix snap_exists API overflow issue Dec 19, 2015
@@ -206,7 +206,9 @@ class CEPH_RBD_API Image

/* snapshots */
int snap_list(std::vector<snap_info_t>& snaps);
/* DEPRECATED; use snap_exists2 */

Choose a reason for hiding this comment

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

Would rather see __attribute__ ((deprecated)) appended to snap_exists.

The original one may overflow and thus not be safe.

Fixes: ceph#14129
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo
Copy link
Member Author

@dillaman Fixed as you suggested, please review. Thanks a lot!

@dillaman
Copy link

Couple more spots that should be swapped over to snap_exists2 to avoid the compile warning:

./include/rbd/librbd.hpp:210:8: note: declared here
   bool snap_exists(const char *snapname) __attribute__ ((deprecated));

@xiexingguo
Copy link
Member Author

@dillaman OK~~~, I'll try to find them out as soon as possible:)

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
@xiexingguo
Copy link
Member Author

@dillaman Fixed, please review:) Thank you for your patience.

dillaman pushed a commit that referenced this pull request Dec 21, 2015
librbd: fix snap_exists API return code overflow

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
@dillaman dillaman merged commit b872697 into ceph:master Dec 21, 2015
@xiexingguo xiexingguo deleted the xxg-wip-14129 branch December 22, 2015 00:30
@ghost ghost changed the title librbd: fix snap_exists API overflow issue librbd: fix snap_exists API return code overflow Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants