{"action":"opened","number":12520,"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/12520","id":98302907,"html_url":"https://github.com/ceph/ceph/pull/12520","diff_url":"https://github.com/ceph/ceph/pull/12520.diff","patch_url":"https://github.com/ceph/ceph/pull/12520.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/12520","number":12520,"state":"open","locked":false,"title":"osdmap: fix divide by zero error","user":{"login":"wwformat","id":3492065,"avatar_url":"https://avatars.githubusercontent.com/u/3492065?v=3","gravatar_id":"","url":"https://api.github.com/users/wwformat","html_url":"https://github.com/wwformat","followers_url":"https://api.github.com/users/wwformat/followers","following_url":"https://api.github.com/users/wwformat/following{/other_user}","gists_url":"https://api.github.com/users/wwformat/gists{/gist_id}","starred_url":"https://api.github.com/users/wwformat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwformat/subscriptions","organizations_url":"https://api.github.com/users/wwformat/orgs","repos_url":"https://api.github.com/users/wwformat/repos","events_url":"https://api.github.com/users/wwformat/events{/privacy}","received_events_url":"https://api.github.com/users/wwformat/received_events","type":"User","site_admin":false},"body":"*** CID 1397255:  Incorrect expression  (DIVIDE_BY_ZERO)\r\n/home/brad/working/src/ceph/src/osd/OSDMap.cc: 2995 in\r\nOSDMap::summarize_mapping_stats(OSDMap*, const std::set<long,\r\nstd::less<long>, std::allocator<long>> *,\r\nstd::__cxx11::basic_string<char, std::char_traits<char>,\r\nstd::allocator<char>> *, ceph::Formatter *) const()\r\n2989         f->open_object_section(\"utilization\");\r\n2990       if (newmap) {\r\n2991         if (f) {\r\n2992           f->dump_unsigned(\"moved_pgs\", moved_pg);\r\n2993           f->dump_unsigned(\"total_pgs\", total_pg);\r\n2994         } else {\r\n>>>     CID 1397255:  Incorrect expression  (DIVIDE_BY_ZERO)\r\n>>>     In expression \"(float)moved_pg * 100. / (float)total_pg\",\r\ndivision by expression \"total_pg\" which may be zero has undefined\r\nbehavior.\r\n2995           ss << \"moved \" << moved_pg << \" / \" << total_pg\r\n2996       << \" (\" << ((float)moved_pg * 100.0 / (float)total_pg) <<\r\n\"%)\\n\";\r\n2997         }\r\n2998       }\r\n2999       if (f) {\r\n3000         f->dump_float(\"avg_pgs\", avg_pg);\r\n\r\nSigned-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>","created_at":"2016-12-16T09:32:32Z","updated_at":"2016-12-16T09:32:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/12520/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/12520/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/12520/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/61d3e4f38c8f620d2c90afbc90a730d631d0df13","head":{"label":"kylinstorage:wip-for-coverity","ref":"wip-for-coverity","sha":"61d3e4f38c8f620d2c90afbc90a730d631d0df13","user":{"login":"kylinstorage","id":15884581,"avatar_url":"https://avatars.githubusercontent.com/u/15884581?v=3","gravatar_id":"","url":"https://api.github.com/users/kylinstorage","html_url":"https://github.com/kylinstorage","followers_url":"https://api.github.com/users/kylinstorage/followers","following_url":"https://api.github.com/users/kylinstorage/following{/other_user}","gists_url":"https://api.github.com/users/kylinstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/kylinstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylinstorage/subscriptions","organizations_url":"https://api.github.com/users/kylinstorage/orgs","repos_url":"https://api.github.com/users/kylinstorage/repos","events_url":"https://api.github.com/users/kylinstorage/events{/privacy}","received_events_url":"https://api.github.com/users/kylinstorage/received_events","type":"Organization","site_admin":false},"repo":{"id":46329840,"name":"ceph","full_name":"kylinstorage/ceph","owner":{"login":"kylinstorage","id":15884581,"avatar_url":"https://avatars.githubusercontent.com/u/15884581?v=3","gravatar_id":"","url":"https://api.github.com/users/kylinstorage","html_url":"https://github.com/kylinstorage","followers_url":"https://api.github.com/users/kylinstorage/followers","following_url":"https://api.github.com/users/kylinstorage/following{/other_user}","gists_url":"https://api.github.com/users/kylinstorage/gists{/gist_id}","starred_url":"https://api.github.com/users/kylinstorage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylinstorage/subscriptions","organizations_url":"https://api.github.com/users/kylinstorage/orgs","repos_url":"https://api.github.com/users/kylinstorage/repos","events_url":"https://api.github.com/users/kylinstorage/events{/privacy}","received_events_url":"https://api.github.com/users/kylinstorage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kylinstorage/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/kylinstorage/ceph","forks_url":"https://api.github.com/repos/kylinstorage/ceph/forks","keys_url":"https://api.github.com/repos/kylinstorage/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kylinstorage/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kylinstorage/ceph/teams","hooks_url":"https://api.github.com/repos/kylinstorage/ceph/hooks","issue_events_url":"https://api.github.com/repos/kylinstorage/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/kylinstorage/ceph/events","assignees_url":"https://api.github.com/repos/kylinstorage/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/kylinstorage/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/kylinstorage/ceph/tags","blobs_url":"https://api.github.com/repos/kylinstorage/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kylinstorage/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kylinstorage/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/kylinstorage/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kylinstorage/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/kylinstorage/ceph/languages","stargazers_url":"https://api.github.com/repos/kylinstorage/ceph/stargazers","contributors_url":"https://api.github.com/repos/kylinstorage/ceph/contributors","subscribers_url":"https://api.github.com/repos/kylinstorage/ceph/subscribers","subscription_url":"https://api.github.com/repos/kylinstorage/ceph/subscription","commits_url":"https://api.github.com/repos/kylinstorage/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/kylinstorage/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/kylinstorage/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/kylinstorage/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/kylinstorage/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/kylinstorage/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kylinstorage/ceph/merges","archive_url":"https://api.github.com/repos/kylinstorage/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kylinstorage/ceph/downloads","issues_url":"https://api.github.com/repos/kylinstorage/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/kylinstorage/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/kylinstorage/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/kylinstorage/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kylinstorage/ceph/labels{/name}","releases_url":"https://api.github.com/repos/kylinstorage/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/kylinstorage/ceph/deployments","created_at":"2015-11-17T07:15:48Z","updated_at":"2016-11-17T06:48:39Z","pushed_at":"2016-12-16T09:30:14Z","git_url":"git://github.com/kylinstorage/ceph.git","ssh_url":"git@github.com:kylinstorage/ceph.git","clone_url":"https://github.com/kylinstorage/ceph.git","svn_url":"https://github.com/kylinstorage/ceph","homepage":"http://ceph.com","size":166464,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"8d7d5ae3ff601153cfe6724cceb0fe767557344d","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph/deployments","created_at":"2011-09-01T21:41:26Z","updated_at":"2016-12-16T08:41:24Z","pushed_at":"2016-12-16T09:07:19Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":185552,"stargazers_count":2714,"watchers_count":2714,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1593,"mirror_url":null,"open_issues_count":389,"forks":1593,"open_issues":389,"watchers":2714,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/12520"},"html":{"href":"https://github.com/ceph/ceph/pull/12520"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/12520"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/12520/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/12520/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/12520/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/61d3e4f38c8f620d2c90afbc90a730d631d0df13"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":4,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"wwformat"}}