{"action":"created","comment":{"url":"https://api.github.com/repos/moby/moby/pulls/comments/181534537","pull_request_review_id":112189044,"id":181534537,"diff_hunk":"@@ -3,14 +3,25 @@\n package btrfs // import \"github.com/docker/docker/daemon/graphdriver/btrfs\"\n \n /*\n-#include <stdlib.h>\n #include <dirent.h>\n-#include <btrfs/ioctl.h>\n+#include <fcntl.h>\n+#include <unistd.h>\n #include <btrfs/ctree.h>\n \n-static void set_name_btrfs_ioctl_vol_args_v2(struct btrfs_ioctl_vol_args_v2* btrfs_struct, const char* value) {\n-    snprintf(btrfs_struct->name, BTRFS_SUBVOL_NAME_MAX, \"%s\", value);\n+static int copy_subvolname_and_free(char* dest, char* name) {\n+\tint r = snprintf(dest, BTRFS_SUBVOL_NAME_MAX, \"%s\", name);","path":"daemon/graphdriver/btrfs/btrfs.go","position":null,"original_position":14,"commit_id":"09feb469c73322bf50057747b29f5933390c0d6a","original_commit_id":"26711072d0279e53e70be15cbd9e6bf99297e325","user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars2.githubusercontent.com/u/1804568?v=4","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"body":"If we need to backport these changes, we may want to have those changes in a separate commit (as the current stable release of Docker is not yet on Go 1.10)","created_at":"2018-04-14T00:28:46Z","updated_at":"2018-04-14T00:28:46Z","html_url":"https://github.com/moby/moby/pull/36536#discussion_r181534537","pull_request_url":"https://api.github.com/repos/moby/moby/pulls/36536","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/moby/moby/pulls/comments/181534537"},"html":{"href":"https://github.com/moby/moby/pull/36536#discussion_r181534537"},"pull_request":{"href":"https://api.github.com/repos/moby/moby/pulls/36536"}},"in_reply_to_id":175669006},"pull_request":{"url":"https://api.github.com/repos/moby/moby/pulls/36536","id":173749296,"html_url":"https://github.com/moby/moby/pull/36536","diff_url":"https://github.com/moby/moby/pull/36536.diff","patch_url":"https://github.com/moby/moby/pull/36536.patch","issue_url":"https://api.github.com/repos/moby/moby/issues/36536","number":36536,"state":"open","locked":false,"title":"set of fixes for btrfs graphdriver","user":{"login":"nikitych","id":11927403,"avatar_url":"https://avatars1.githubusercontent.com/u/11927403?v=4","gravatar_id":"","url":"https://api.github.com/users/nikitych","html_url":"https://github.com/nikitych","followers_url":"https://api.github.com/users/nikitych/followers","following_url":"https://api.github.com/users/nikitych/following{/other_user}","gists_url":"https://api.github.com/users/nikitych/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitych/subscriptions","organizations_url":"https://api.github.com/users/nikitych/orgs","repos_url":"https://api.github.com/users/nikitych/repos","events_url":"https://api.github.com/users/nikitych/events{/privacy}","received_events_url":"https://api.github.com/users/nikitych/received_events","type":"User","site_admin":false},"body":"<!--\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/moby/moby/blob/master/CONTRIBUTING.md\r\n\r\n** Make sure all your commits include a signature generated with `git commit -s` **\r\n\r\nFor additional information on our contributing process, read our contributing\r\nguide https://docs.docker.com/opensource/code/\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\"\r\n\r\nPlease provide the following information:\r\n-->\r\n**- What I did**\r\nFixes #35630 btrfs graphdriver keeps subvolumes in readonly state while they not used by `Get`.\r\nRework subvolumes delete function in more efficient way.\r\nFix quotas usage to handle cases while file system shared with others.\r\n\r\n**- How I did it**\r\nI add subvolSetPropRO function to btrfs graphdriver which could set readonly property to subvolume, and call it at Get or Put.\r\nRework subvolDelete to increase performance by using BTRFS_IOC_TREE_SEARCH and left a full walk of the directory tree as a last resort. Also handle paths longer than PATH_MAX.\r\nEliminate in-process quota state. Remove ability to disable quotas because only user know when it's save. Invoke quotas rescan when it's really necessary.\r\n\r\n**- How to verify it**\r\nIntermediate layers in /var/lib/docker/btrfs/subvolumes/ are read-only. Try to write something and you'll see.\r\nEnable quotas before daemon start or disable while it's running. Qgroups not left after deleted subvols, quota rescan normally not happen.\r\n\r\n**- Description for the changelog**\r\nbtrfs graphdriver keeps subvolumes in read-only state when possible\r\n","created_at":"2018-03-08T14:26:13Z","updated_at":"2018-04-14T00:28:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"089e6e0512ed870ec87f5effe359419d927c60ab","assignee":{"login":"coolljt0725","id":8232360,"avatar_url":"https://avatars3.githubusercontent.com/u/8232360?v=4","gravatar_id":"","url":"https://api.github.com/users/coolljt0725","html_url":"https://github.com/coolljt0725","followers_url":"https://api.github.com/users/coolljt0725/followers","following_url":"https://api.github.com/users/coolljt0725/following{/other_user}","gists_url":"https://api.github.com/users/coolljt0725/gists{/gist_id}","starred_url":"https://api.github.com/users/coolljt0725/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolljt0725/subscriptions","organizations_url":"https://api.github.com/users/coolljt0725/orgs","repos_url":"https://api.github.com/users/coolljt0725/repos","events_url":"https://api.github.com/users/coolljt0725/events{/privacy}","received_events_url":"https://api.github.com/users/coolljt0725/received_events","type":"User","site_admin":false},"assignees":[{"login":"coolljt0725","id":8232360,"avatar_url":"https://avatars3.githubusercontent.com/u/8232360?v=4","gravatar_id":"","url":"https://api.github.com/users/coolljt0725","html_url":"https://github.com/coolljt0725","followers_url":"https://api.github.com/users/coolljt0725/followers","following_url":"https://api.github.com/users/coolljt0725/following{/other_user}","gists_url":"https://api.github.com/users/coolljt0725/gists{/gist_id}","starred_url":"https://api.github.com/users/coolljt0725/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolljt0725/subscriptions","organizations_url":"https://api.github.com/users/coolljt0725/orgs","repos_url":"https://api.github.com/users/coolljt0725/repos","events_url":"https://api.github.com/users/coolljt0725/events{/privacy}","received_events_url":"https://api.github.com/users/coolljt0725/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":87450956,"url":"https://api.github.com/repos/moby/moby/labels/area/storage/btrfs","name":"area/storage/btrfs","color":"fbca04","default":false},{"id":175375407,"url":"https://api.github.com/repos/moby/moby/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/moby/moby/pulls/36536/commits","review_comments_url":"https://api.github.com/repos/moby/moby/pulls/36536/comments","review_comment_url":"https://api.github.com/repos/moby/moby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moby/moby/issues/36536/comments","statuses_url":"https://api.github.com/repos/moby/moby/statuses/09feb469c73322bf50057747b29f5933390c0d6a","head":{"label":"nikitych:35630-btrfs-graphdriver-ro","ref":"35630-btrfs-graphdriver-ro","sha":"09feb469c73322bf50057747b29f5933390c0d6a","user":{"login":"nikitych","id":11927403,"avatar_url":"https://avatars1.githubusercontent.com/u/11927403?v=4","gravatar_id":"","url":"https://api.github.com/users/nikitych","html_url":"https://github.com/nikitych","followers_url":"https://api.github.com/users/nikitych/followers","following_url":"https://api.github.com/users/nikitych/following{/other_user}","gists_url":"https://api.github.com/users/nikitych/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitych/subscriptions","organizations_url":"https://api.github.com/users/nikitych/orgs","repos_url":"https://api.github.com/users/nikitych/repos","events_url":"https://api.github.com/users/nikitych/events{/privacy}","received_events_url":"https://api.github.com/users/nikitych/received_events","type":"User","site_admin":false},"repo":{"id":112356444,"name":"moby","full_name":"nikitych/moby","owner":{"login":"nikitych","id":11927403,"avatar_url":"https://avatars1.githubusercontent.com/u/11927403?v=4","gravatar_id":"","url":"https://api.github.com/users/nikitych","html_url":"https://github.com/nikitych","followers_url":"https://api.github.com/users/nikitych/followers","following_url":"https://api.github.com/users/nikitych/following{/other_user}","gists_url":"https://api.github.com/users/nikitych/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitych/subscriptions","organizations_url":"https://api.github.com/users/nikitych/orgs","repos_url":"https://api.github.com/users/nikitych/repos","events_url":"https://api.github.com/users/nikitych/events{/privacy}","received_events_url":"https://api.github.com/users/nikitych/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikitych/moby","description":"Moby Project - a collaborative project for the container ecosystem to assemble container-based systems","fork":true,"url":"https://api.github.com/repos/nikitych/moby","forks_url":"https://api.github.com/repos/nikitych/moby/forks","keys_url":"https://api.github.com/repos/nikitych/moby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikitych/moby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikitych/moby/teams","hooks_url":"https://api.github.com/repos/nikitych/moby/hooks","issue_events_url":"https://api.github.com/repos/nikitych/moby/issues/events{/number}","events_url":"https://api.github.com/repos/nikitych/moby/events","assignees_url":"https://api.github.com/repos/nikitych/moby/assignees{/user}","branches_url":"https://api.github.com/repos/nikitych/moby/branches{/branch}","tags_url":"https://api.github.com/repos/nikitych/moby/tags","blobs_url":"https://api.github.com/repos/nikitych/moby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikitych/moby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikitych/moby/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikitych/moby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikitych/moby/statuses/{sha}","languages_url":"https://api.github.com/repos/nikitych/moby/languages","stargazers_url":"https://api.github.com/repos/nikitych/moby/stargazers","contributors_url":"https://api.github.com/repos/nikitych/moby/contributors","subscribers_url":"https://api.github.com/repos/nikitych/moby/subscribers","subscription_url":"https://api.github.com/repos/nikitych/moby/subscription","commits_url":"https://api.github.com/repos/nikitych/moby/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikitych/moby/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikitych/moby/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikitych/moby/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikitych/moby/contents/{+path}","compare_url":"https://api.github.com/repos/nikitych/moby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikitych/moby/merges","archive_url":"https://api.github.com/repos/nikitych/moby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikitych/moby/downloads","issues_url":"https://api.github.com/repos/nikitych/moby/issues{/number}","pulls_url":"https://api.github.com/repos/nikitych/moby/pulls{/number}","milestones_url":"https://api.github.com/repos/nikitych/moby/milestones{/number}","notifications_url":"https://api.github.com/repos/nikitych/moby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikitych/moby/labels{/name}","releases_url":"https://api.github.com/repos/nikitych/moby/releases{/id}","deployments_url":"https://api.github.com/repos/nikitych/moby/deployments","created_at":"2017-11-28T15:55:54Z","updated_at":"2017-11-28T15:56:08Z","pushed_at":"2018-04-13T18:12:42Z","git_url":"git://github.com/nikitych/moby.git","ssh_url":"git@github.com:nikitych/moby.git","clone_url":"https://github.com/nikitych/moby.git","svn_url":"https://github.com/nikitych/moby","homepage":"https://mobyproject.org/","size":132462,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"moby:master","ref":"master","sha":"544ec0994f3979314b0c3a892a4e352145d0cc0b","user":{"login":"moby","id":27259197,"avatar_url":"https://avatars1.githubusercontent.com/u/27259197?v=4","gravatar_id":"","url":"https://api.github.com/users/moby","html_url":"https://github.com/moby","followers_url":"https://api.github.com/users/moby/followers","following_url":"https://api.github.com/users/moby/following{/other_user}","gists_url":"https://api.github.com/users/moby/gists{/gist_id}","starred_url":"https://api.github.com/users/moby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moby/subscriptions","organizations_url":"https://api.github.com/users/moby/orgs","repos_url":"https://api.github.com/users/moby/repos","events_url":"https://api.github.com/users/moby/events{/privacy}","received_events_url":"https://api.github.com/users/moby/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"moby","full_name":"moby/moby","owner":{"login":"moby","id":27259197,"avatar_url":"https://avatars1.githubusercontent.com/u/27259197?v=4","gravatar_id":"","url":"https://api.github.com/users/moby","html_url":"https://github.com/moby","followers_url":"https://api.github.com/users/moby/followers","following_url":"https://api.github.com/users/moby/following{/other_user}","gists_url":"https://api.github.com/users/moby/gists{/gist_id}","starred_url":"https://api.github.com/users/moby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moby/subscriptions","organizations_url":"https://api.github.com/users/moby/orgs","repos_url":"https://api.github.com/users/moby/repos","events_url":"https://api.github.com/users/moby/events{/privacy}","received_events_url":"https://api.github.com/users/moby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moby/moby","description":"Moby Project - a collaborative project for the container ecosystem to assemble container-based systems","fork":false,"url":"https://api.github.com/repos/moby/moby","forks_url":"https://api.github.com/repos/moby/moby/forks","keys_url":"https://api.github.com/repos/moby/moby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moby/moby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moby/moby/teams","hooks_url":"https://api.github.com/repos/moby/moby/hooks","issue_events_url":"https://api.github.com/repos/moby/moby/issues/events{/number}","events_url":"https://api.github.com/repos/moby/moby/events","assignees_url":"https://api.github.com/repos/moby/moby/assignees{/user}","branches_url":"https://api.github.com/repos/moby/moby/branches{/branch}","tags_url":"https://api.github.com/repos/moby/moby/tags","blobs_url":"https://api.github.com/repos/moby/moby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moby/moby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moby/moby/git/refs{/sha}","trees_url":"https://api.github.com/repos/moby/moby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moby/moby/statuses/{sha}","languages_url":"https://api.github.com/repos/moby/moby/languages","stargazers_url":"https://api.github.com/repos/moby/moby/stargazers","contributors_url":"https://api.github.com/repos/moby/moby/contributors","subscribers_url":"https://api.github.com/repos/moby/moby/subscribers","subscription_url":"https://api.github.com/repos/moby/moby/subscription","commits_url":"https://api.github.com/repos/moby/moby/commits{/sha}","git_commits_url":"https://api.github.com/repos/moby/moby/git/commits{/sha}","comments_url":"https://api.github.com/repos/moby/moby/comments{/number}","issue_comment_url":"https://api.github.com/repos/moby/moby/issues/comments{/number}","contents_url":"https://api.github.com/repos/moby/moby/contents/{+path}","compare_url":"https://api.github.com/repos/moby/moby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moby/moby/merges","archive_url":"https://api.github.com/repos/moby/moby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moby/moby/downloads","issues_url":"https://api.github.com/repos/moby/moby/issues{/number}","pulls_url":"https://api.github.com/repos/moby/moby/pulls{/number}","milestones_url":"https://api.github.com/repos/moby/moby/milestones{/number}","notifications_url":"https://api.github.com/repos/moby/moby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moby/moby/labels{/name}","releases_url":"https://api.github.com/repos/moby/moby/releases{/id}","deployments_url":"https://api.github.com/repos/moby/moby/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2018-04-13T23:57:13Z","pushed_at":"2018-04-13T23:56:39Z","git_url":"git://github.com/moby/moby.git","ssh_url":"git@github.com:moby/moby.git","clone_url":"https://github.com/moby/moby.git","svn_url":"https://github.com/moby/moby","homepage":"https://mobyproject.org/","size":132457,"stargazers_count":48456,"watchers_count":48456,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14248,"mirror_url":null,"archived":false,"open_issues_count":3173,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":14248,"open_issues":3173,"watchers":48456,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/moby/moby/pulls/36536"},"html":{"href":"https://github.com/moby/moby/pull/36536"},"issue":{"href":"https://api.github.com/repos/moby/moby/issues/36536"},"comments":{"href":"https://api.github.com/repos/moby/moby/issues/36536/comments"},"review_comments":{"href":"https://api.github.com/repos/moby/moby/pulls/36536/comments"},"review_comment":{"href":"https://api.github.com/repos/moby/moby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moby/moby/pulls/36536/commits"},"statuses":{"href":"https://api.github.com/repos/moby/moby/statuses/09feb469c73322bf50057747b29f5933390c0d6a"}},"author_association":"NONE"}}
{"actor":{"display_login":"thaJeztah"}}