{"action":"created","issue":{"url":"https://api.github.com/repos/ceph/ceph/issues/6988","labels_url":"https://api.github.com/repos/ceph/ceph/issues/6988/labels{/name}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/6988/comments","events_url":"https://api.github.com/repos/ceph/ceph/issues/6988/events","html_url":"https://github.com/ceph/ceph/pull/6988","id":123160348,"number":6988,"title":"FileJournal: fix return code of create method","user":{"login":"xiexingguo","id":14193361,"avatar_url":"https://avatars.githubusercontent.com/u/14193361?v=3","gravatar_id":"","url":"https://api.github.com/users/xiexingguo","html_url":"https://github.com/xiexingguo","followers_url":"https://api.github.com/users/xiexingguo/followers","following_url":"https://api.github.com/users/xiexingguo/following{/other_user}","gists_url":"https://api.github.com/users/xiexingguo/gists{/gist_id}","starred_url":"https://api.github.com/users/xiexingguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiexingguo/subscriptions","organizations_url":"https://api.github.com/users/xiexingguo/orgs","repos_url":"https://api.github.com/users/xiexingguo/repos","events_url":"https://api.github.com/users/xiexingguo/events{/privacy}","received_events_url":"https://api.github.com/users/xiexingguo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dzafman","id":2467610,"avatar_url":"https://avatars.githubusercontent.com/u/2467610?v=3","gravatar_id":"","url":"https://api.github.com/users/dzafman","html_url":"https://github.com/dzafman","followers_url":"https://api.github.com/users/dzafman/followers","following_url":"https://api.github.com/users/dzafman/following{/other_user}","gists_url":"https://api.github.com/users/dzafman/gists{/gist_id}","starred_url":"https://api.github.com/users/dzafman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzafman/subscriptions","organizations_url":"https://api.github.com/users/dzafman/orgs","repos_url":"https://api.github.com/users/dzafman/repos","events_url":"https://api.github.com/users/dzafman/events{/privacy}","received_events_url":"https://api.github.com/users/dzafman/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-12-20T13:42:44Z","updated_at":"2015-12-22T02:13:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/6988","html_url":"https://github.com/ceph/ceph/pull/6988","diff_url":"https://github.com/ceph/ceph/pull/6988.diff","patch_url":"https://github.com/ceph/ceph/pull/6988.patch"},"body":"Shall return negative error code instead.\r\n\r\nFixes: #14134\r\nSigned-off-by: xie xingguo <xie.xingguo@zte.com.cn>"},"comment":{"url":"https://api.github.com/repos/ceph/ceph/issues/comments/166481117","html_url":"https://github.com/ceph/ceph/pull/6988#issuecomment-166481117","issue_url":"https://api.github.com/repos/ceph/ceph/issues/6988","id":166481117,"user":{"login":"xiexingguo","id":14193361,"avatar_url":"https://avatars.githubusercontent.com/u/14193361?v=3","gravatar_id":"","url":"https://api.github.com/users/xiexingguo","html_url":"https://github.com/xiexingguo","followers_url":"https://api.github.com/users/xiexingguo/followers","following_url":"https://api.github.com/users/xiexingguo/following{/other_user}","gists_url":"https://api.github.com/users/xiexingguo/gists{/gist_id}","starred_url":"https://api.github.com/users/xiexingguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiexingguo/subscriptions","organizations_url":"https://api.github.com/users/xiexingguo/orgs","repos_url":"https://api.github.com/users/xiexingguo/repos","events_url":"https://api.github.com/users/xiexingguo/events{/privacy}","received_events_url":"https://api.github.com/users/xiexingguo/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T02:13:48Z","updated_at":"2015-12-22T02:13:48Z","body":"@dzafman \r\nIt seems that the following call stack will be problematic:\r\nmain(from ceph_osd.cc)->FileStore::mkjournal()->FileJournal::create()\r\n\r\nYou may check the following code logic\r\n\r\n  if (mkjournal) {\r\n    common_init_finish(g_ceph_context);\r\n    int err = store->mkjournal();\r\n    if (err < 0) {\r\n      derr << TEXT_RED << \" ** ERROR: error creating fresh journal \" << g_conf->osd_journal\r\n\t   << \" for object store \" << g_conf->osd_data\r\n\t   << \": \" << cpp_strerror(-err) << TEXT_NORMAL << dendl;\r\n      exit(1);\r\n    }\r\n    derr << \"created new journal \" << g_conf->osd_journal\r\n\t << \" for object store \" << g_conf->osd_data << dendl;\r\n    exit(0);\r\n  }\r\n\r\nAs you can see, the above code logic is not able to capture a positive error code return by mkjournal()."}}