{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/72175117","id":72175117,"diff_hunk":"@@ -3373,14 +3373,21 @@ bool BlueStore::exists(CollectionHandle &c_, const ghobject_t& oid)\n   dout(10) << __func__ << \" \" << c->cid << \" \" << oid << dendl;\n   if (!c->exists)\n     return false;\n-  RWLock::RLocker l(c->lock);\n-  OnodeRef o = c->get_onode(oid, false);\n+\n+  bool r = true;\n+\n+  {\n+    RWLock::RLocker l(c->lock);\n+    OnodeRef o = c->get_onode(oid, false);\n+    if (!o || !o->exists)\n+      r = false;\n+  }\n+","path":"src/os/bluestore/BlueStore.cc","position":25,"original_position":15,"commit_id":"33a7dcf8ae63d9dc9d089d032c2be36a60eaa81d","original_commit_id":"287cc24ebda49152183555830a2f6332a20f4893","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},"body":"Negative, `cache->trim()` does cache cleanup only and is under its own mutex protection already.\r\n\r\n\r\n\r\n> We can't do that cache->trim needs to be within collection lock as it is modifying onode structures..\r\n\r\nOtherwise shouldn't we promote to `WLocker(c->lock)` here?\r\n","created_at":"2016-07-26T01:29:58Z","updated_at":"2016-07-26T01:29:58Z","html_url":"https://github.com/ceph/ceph/pull/10410#discussion_r72175117","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/10410","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/72175117"},"html":{"href":"https://github.com/ceph/ceph/pull/10410#discussion_r72175117"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10410"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/10410","id":78567698,"html_url":"https://github.com/ceph/ceph/pull/10410","diff_url":"https://github.com/ceph/ceph/pull/10410.diff","patch_url":"https://github.com/ceph/ceph/pull/10410.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/10410","number":10410,"state":"open","locked":false,"title":"os/bluestore: narrow lock scope for cache trim()","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},"body":"The cache trim() process can become time consuming\r\nwhen the cache size is huge. Since it can be operated\r\nsafely under its own internal mutex, we shall avoid\r\nto hold irrelevant locks when possible, which is good\r\n for performance.","created_at":"2016-07-23T09:05:36Z","updated_at":"2016-07-26T01:29:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3983de865c104e834b7dc1f81347229ab7ad5ec0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/10410/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/10410/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/10410/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/33a7dcf8ae63d9dc9d089d032c2be36a60eaa81d","head":{"label":"xiexingguo:xxg-wip-bluestore-2016-07-23","ref":"xxg-wip-bluestore-2016-07-23","sha":"33a7dcf8ae63d9dc9d089d032c2be36a60eaa81d","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},"repo":{"id":45168396,"name":"ceph","full_name":"xiexingguo/ceph","owner":{"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},"private":false,"html_url":"https://github.com/xiexingguo/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/xiexingguo/ceph","forks_url":"https://api.github.com/repos/xiexingguo/ceph/forks","keys_url":"https://api.github.com/repos/xiexingguo/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xiexingguo/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xiexingguo/ceph/teams","hooks_url":"https://api.github.com/repos/xiexingguo/ceph/hooks","issue_events_url":"https://api.github.com/repos/xiexingguo/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/xiexingguo/ceph/events","assignees_url":"https://api.github.com/repos/xiexingguo/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/xiexingguo/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/xiexingguo/ceph/tags","blobs_url":"https://api.github.com/repos/xiexingguo/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xiexingguo/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xiexingguo/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/xiexingguo/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xiexingguo/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/xiexingguo/ceph/languages","stargazers_url":"https://api.github.com/repos/xiexingguo/ceph/stargazers","contributors_url":"https://api.github.com/repos/xiexingguo/ceph/contributors","subscribers_url":"https://api.github.com/repos/xiexingguo/ceph/subscribers","subscription_url":"https://api.github.com/repos/xiexingguo/ceph/subscription","commits_url":"https://api.github.com/repos/xiexingguo/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/xiexingguo/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/xiexingguo/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/xiexingguo/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/xiexingguo/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/xiexingguo/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xiexingguo/ceph/merges","archive_url":"https://api.github.com/repos/xiexingguo/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xiexingguo/ceph/downloads","issues_url":"https://api.github.com/repos/xiexingguo/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/xiexingguo/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/xiexingguo/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/xiexingguo/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xiexingguo/ceph/labels{/name}","releases_url":"https://api.github.com/repos/xiexingguo/ceph/releases{/id}","deployments_url":"https://api.github.com/repos/xiexingguo/ceph/deployments","created_at":"2015-10-29T07:51:41Z","updated_at":"2016-01-11T08:49:47Z","pushed_at":"2016-07-25T14:31:26Z","git_url":"git://github.com/xiexingguo/ceph.git","ssh_url":"git@github.com:xiexingguo/ceph.git","clone_url":"https://github.com/xiexingguo/ceph.git","svn_url":"https://github.com/xiexingguo/ceph","homepage":"http://ceph.com","size":170428,"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":"f84be8f6a6a16f01fd8600405779e469b7ba808b","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-07-25T08:33:54Z","pushed_at":"2016-07-26T01:20: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":228997,"stargazers_count":2324,"watchers_count":2324,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1383,"mirror_url":null,"open_issues_count":496,"forks":1383,"open_issues":496,"watchers":2324,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10410"},"html":{"href":"https://github.com/ceph/ceph/pull/10410"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/10410"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/10410/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10410/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/10410/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/33a7dcf8ae63d9dc9d089d032c2be36a60eaa81d"}}}}
{"actor":{"display_login":"xiexingguo"}}