{"action":"created","comment":{"url":"https://api.github.com/repos/gluster/glusterd2/pulls/comments/197029681","pull_request_review_id":130688895,"id":197029681,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzAyOTY4MQ==","diff_hunk":"@@ -3,38 +3,65 @@ package quota\n import (\n \t\"fmt\"\n \n+\tdaemon \"github.com/gluster/glusterd2/glusterd2/daemon\"\n \t\"github.com/gluster/glusterd2/glusterd2/volume\"\n \t\"github.com/gluster/glusterd2/glusterd2/xlator\"\n+\t\"github.com/gluster/glusterd2/pkg/errors\"\n )\n \n const (\n-\tquotaEnabledKey = \"features.quota\"\n+\tquotaEnabledKey = \"quota.enable\"\n )\n \n func validateOptions(v *volume.Volinfo, key string, value string) error {\n \n-\tif isQuotaEnabled(v) == false {\n-\t\terr := fmt.Errorf(\"Quota not enabled to set this value: '%s'\", key)\n-\t\treturn err\n+\t// Check if volume is started\n+\tif v.State != volume.VolStarted {\n+\t\treturn errors.ErrVolNotStarted\n \t}\n \n \tswitch key {\n-\tcase \"deem-statfs\":\n+\tcase \"enable\":\n+\t\tswitch value {\n+\t\tcase \"on\":\n+\t\t\tret, err := isQuotadRunning()\n+\t\t\tif err == nil && ret {\n+\t\t\t\t// As quotad for various process share a\n+\t\t\t\t// single pid, it is necessary to check the\n+\t\t\t\t// options too.\n+\t\t\t\tif isQuotaEnabled(v) {\n+\t\t\t\t\treturn errors.ErrProcessAlreadyRunning\n+\t\t\t\t}\n+\n+\t\t\t}\n+\t\tcase \"off\":\n+\t\t\tret, err := isQuotadRunning()\n+\t\t\tif !ret {\n+\t\t\t\treturn err\n+\t\t\t}\n+\t\t}\n \t\treturn nil\n+\tcase \"deem-statfs\":\n+\t\tfallthrough\n \tcase \"hard-timeout\":\n-\t\treturn nil\n+\t\tfallthrough\n \tcase \"soft-timeout\":\n-\t\treturn nil\n+\t\tfallthrough\n \tcase \"alert-time\":\n-\t\treturn nil\n+\t\tfallthrough\n \tcase \"default-soft-limit\":\n-\t\treturn nil\n+\t\tif isQuotaEnabled(v) == false {\n+\t\t\treturn fmt.Errorf(\"Quota not enabled to set this value: '%s'\", key)","path":"plugins/quota/validate.go","position":61,"original_position":61,"commit_id":"96b6756f82d7f6dfb2714f4fceaac42e768eb3f4","original_commit_id":"96b6756f82d7f6dfb2714f4fceaac42e768eb3f4","user":{"login":"harigowtham","id":11406648,"node_id":"MDQ6VXNlcjExNDA2NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/11406648?v=4","gravatar_id":"","url":"https://api.github.com/users/harigowtham","html_url":"https://github.com/harigowtham","followers_url":"https://api.github.com/users/harigowtham/followers","following_url":"https://api.github.com/users/harigowtham/following{/other_user}","gists_url":"https://api.github.com/users/harigowtham/gists{/gist_id}","starred_url":"https://api.github.com/users/harigowtham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harigowtham/subscriptions","organizations_url":"https://api.github.com/users/harigowtham/orgs","repos_url":"https://api.github.com/users/harigowtham/repos","events_url":"https://api.github.com/users/harigowtham/events{/privacy}","received_events_url":"https://api.github.com/users/harigowtham/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-06-21T07:04:51Z","updated_at":"2018-06-21T07:04:51Z","html_url":"https://github.com/gluster/glusterd2/pull/615#discussion_r197029681","pull_request_url":"https://api.github.com/repos/gluster/glusterd2/pulls/615","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/comments/197029681"},"html":{"href":"https://github.com/gluster/glusterd2/pull/615#discussion_r197029681"},"pull_request":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/615"}},"in_reply_to_id":197020844},"pull_request":{"url":"https://api.github.com/repos/gluster/glusterd2/pulls/615","id":176974076,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc2OTc0MDc2","html_url":"https://github.com/gluster/glusterd2/pull/615","diff_url":"https://github.com/gluster/glusterd2/pull/615.diff","patch_url":"https://github.com/gluster/glusterd2/pull/615.patch","issue_url":"https://api.github.com/repos/gluster/glusterd2/issues/615","number":615,"state":"open","locked":false,"title":"quota: disable quotad","user":{"login":"harigowtham","id":11406648,"node_id":"MDQ6VXNlcjExNDA2NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/11406648?v=4","gravatar_id":"","url":"https://api.github.com/users/harigowtham","html_url":"https://github.com/harigowtham","followers_url":"https://api.github.com/users/harigowtham/followers","following_url":"https://api.github.com/users/harigowtham/following{/other_user}","gists_url":"https://api.github.com/users/harigowtham/gists{/gist_id}","starred_url":"https://api.github.com/users/harigowtham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harigowtham/subscriptions","organizations_url":"https://api.github.com/users/harigowtham/orgs","repos_url":"https://api.github.com/users/harigowtham/repos","events_url":"https://api.github.com/users/harigowtham/events{/privacy}","received_events_url":"https://api.github.com/users/harigowtham/received_events","type":"User","site_admin":false},"body":"disable quota daemon from api.\r\ncli yet to be worked on.\r\n\r\nUpdates: #421\r\nSigned-off-by: Hari Gowtham <hgowtham@redhat.com>","created_at":"2018-03-23T05:00:28Z","updated_at":"2018-06-21T07:04:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2e605e60e67f7859804c7949997d46a3eb5be8d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/gluster/glusterd2/pulls/615/commits","review_comments_url":"https://api.github.com/repos/gluster/glusterd2/pulls/615/comments","review_comment_url":"https://api.github.com/repos/gluster/glusterd2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gluster/glusterd2/issues/615/comments","statuses_url":"https://api.github.com/repos/gluster/glusterd2/statuses/96b6756f82d7f6dfb2714f4fceaac42e768eb3f4","head":{"label":"harigowtham:quota_disable","ref":"quota_disable","sha":"96b6756f82d7f6dfb2714f4fceaac42e768eb3f4","user":{"login":"harigowtham","id":11406648,"node_id":"MDQ6VXNlcjExNDA2NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/11406648?v=4","gravatar_id":"","url":"https://api.github.com/users/harigowtham","html_url":"https://github.com/harigowtham","followers_url":"https://api.github.com/users/harigowtham/followers","following_url":"https://api.github.com/users/harigowtham/following{/other_user}","gists_url":"https://api.github.com/users/harigowtham/gists{/gist_id}","starred_url":"https://api.github.com/users/harigowtham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harigowtham/subscriptions","organizations_url":"https://api.github.com/users/harigowtham/orgs","repos_url":"https://api.github.com/users/harigowtham/repos","events_url":"https://api.github.com/users/harigowtham/events{/privacy}","received_events_url":"https://api.github.com/users/harigowtham/received_events","type":"User","site_admin":false},"repo":{"id":102003268,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIwMDMyNjg=","name":"glusterd2","full_name":"harigowtham/glusterd2","owner":{"login":"harigowtham","id":11406648,"node_id":"MDQ6VXNlcjExNDA2NjQ4","avatar_url":"https://avatars3.githubusercontent.com/u/11406648?v=4","gravatar_id":"","url":"https://api.github.com/users/harigowtham","html_url":"https://github.com/harigowtham","followers_url":"https://api.github.com/users/harigowtham/followers","following_url":"https://api.github.com/users/harigowtham/following{/other_user}","gists_url":"https://api.github.com/users/harigowtham/gists{/gist_id}","starred_url":"https://api.github.com/users/harigowtham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harigowtham/subscriptions","organizations_url":"https://api.github.com/users/harigowtham/orgs","repos_url":"https://api.github.com/users/harigowtham/repos","events_url":"https://api.github.com/users/harigowtham/events{/privacy}","received_events_url":"https://api.github.com/users/harigowtham/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harigowtham/glusterd2","description":"GlusterD-2.0 is the distributed management framework to be used for GlusterFS-4.0","fork":true,"url":"https://api.github.com/repos/harigowtham/glusterd2","forks_url":"https://api.github.com/repos/harigowtham/glusterd2/forks","keys_url":"https://api.github.com/repos/harigowtham/glusterd2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harigowtham/glusterd2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harigowtham/glusterd2/teams","hooks_url":"https://api.github.com/repos/harigowtham/glusterd2/hooks","issue_events_url":"https://api.github.com/repos/harigowtham/glusterd2/issues/events{/number}","events_url":"https://api.github.com/repos/harigowtham/glusterd2/events","assignees_url":"https://api.github.com/repos/harigowtham/glusterd2/assignees{/user}","branches_url":"https://api.github.com/repos/harigowtham/glusterd2/branches{/branch}","tags_url":"https://api.github.com/repos/harigowtham/glusterd2/tags","blobs_url":"https://api.github.com/repos/harigowtham/glusterd2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harigowtham/glusterd2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harigowtham/glusterd2/git/refs{/sha}","trees_url":"https://api.github.com/repos/harigowtham/glusterd2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harigowtham/glusterd2/statuses/{sha}","languages_url":"https://api.github.com/repos/harigowtham/glusterd2/languages","stargazers_url":"https://api.github.com/repos/harigowtham/glusterd2/stargazers","contributors_url":"https://api.github.com/repos/harigowtham/glusterd2/contributors","subscribers_url":"https://api.github.com/repos/harigowtham/glusterd2/subscribers","subscription_url":"https://api.github.com/repos/harigowtham/glusterd2/subscription","commits_url":"https://api.github.com/repos/harigowtham/glusterd2/commits{/sha}","git_commits_url":"https://api.github.com/repos/harigowtham/glusterd2/git/commits{/sha}","comments_url":"https://api.github.com/repos/harigowtham/glusterd2/comments{/number}","issue_comment_url":"https://api.github.com/repos/harigowtham/glusterd2/issues/comments{/number}","contents_url":"https://api.github.com/repos/harigowtham/glusterd2/contents/{+path}","compare_url":"https://api.github.com/repos/harigowtham/glusterd2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harigowtham/glusterd2/merges","archive_url":"https://api.github.com/repos/harigowtham/glusterd2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harigowtham/glusterd2/downloads","issues_url":"https://api.github.com/repos/harigowtham/glusterd2/issues{/number}","pulls_url":"https://api.github.com/repos/harigowtham/glusterd2/pulls{/number}","milestones_url":"https://api.github.com/repos/harigowtham/glusterd2/milestones{/number}","notifications_url":"https://api.github.com/repos/harigowtham/glusterd2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harigowtham/glusterd2/labels{/name}","releases_url":"https://api.github.com/repos/harigowtham/glusterd2/releases{/id}","deployments_url":"https://api.github.com/repos/harigowtham/glusterd2/deployments","created_at":"2017-08-31T13:25:28Z","updated_at":"2017-08-31T13:25:29Z","pushed_at":"2018-06-20T09:58:08Z","git_url":"git://github.com/harigowtham/glusterd2.git","ssh_url":"git@github.com:harigowtham/glusterd2.git","clone_url":"https://github.com/harigowtham/glusterd2.git","svn_url":"https://github.com/harigowtham/glusterd2","homepage":"","size":12529,"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":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gluster:master","ref":"master","sha":"14cb4459bbc7c583f5e82e1095692af3446c52ad","user":{"login":"gluster","id":622644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMjY0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/622644?v=4","gravatar_id":"","url":"https://api.github.com/users/gluster","html_url":"https://github.com/gluster","followers_url":"https://api.github.com/users/gluster/followers","following_url":"https://api.github.com/users/gluster/following{/other_user}","gists_url":"https://api.github.com/users/gluster/gists{/gist_id}","starred_url":"https://api.github.com/users/gluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluster/subscriptions","organizations_url":"https://api.github.com/users/gluster/orgs","repos_url":"https://api.github.com/users/gluster/repos","events_url":"https://api.github.com/users/gluster/events{/privacy}","received_events_url":"https://api.github.com/users/gluster/received_events","type":"Organization","site_admin":false},"repo":{"id":24369600,"node_id":"MDEwOlJlcG9zaXRvcnkyNDM2OTYwMA==","name":"glusterd2","full_name":"gluster/glusterd2","owner":{"login":"gluster","id":622644,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMjY0NA==","avatar_url":"https://avatars3.githubusercontent.com/u/622644?v=4","gravatar_id":"","url":"https://api.github.com/users/gluster","html_url":"https://github.com/gluster","followers_url":"https://api.github.com/users/gluster/followers","following_url":"https://api.github.com/users/gluster/following{/other_user}","gists_url":"https://api.github.com/users/gluster/gists{/gist_id}","starred_url":"https://api.github.com/users/gluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gluster/subscriptions","organizations_url":"https://api.github.com/users/gluster/orgs","repos_url":"https://api.github.com/users/gluster/repos","events_url":"https://api.github.com/users/gluster/events{/privacy}","received_events_url":"https://api.github.com/users/gluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gluster/glusterd2","description":"GlusterD-2.0 is the distributed management framework to be used for GlusterFS-4.0","fork":false,"url":"https://api.github.com/repos/gluster/glusterd2","forks_url":"https://api.github.com/repos/gluster/glusterd2/forks","keys_url":"https://api.github.com/repos/gluster/glusterd2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gluster/glusterd2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gluster/glusterd2/teams","hooks_url":"https://api.github.com/repos/gluster/glusterd2/hooks","issue_events_url":"https://api.github.com/repos/gluster/glusterd2/issues/events{/number}","events_url":"https://api.github.com/repos/gluster/glusterd2/events","assignees_url":"https://api.github.com/repos/gluster/glusterd2/assignees{/user}","branches_url":"https://api.github.com/repos/gluster/glusterd2/branches{/branch}","tags_url":"https://api.github.com/repos/gluster/glusterd2/tags","blobs_url":"https://api.github.com/repos/gluster/glusterd2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gluster/glusterd2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gluster/glusterd2/git/refs{/sha}","trees_url":"https://api.github.com/repos/gluster/glusterd2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gluster/glusterd2/statuses/{sha}","languages_url":"https://api.github.com/repos/gluster/glusterd2/languages","stargazers_url":"https://api.github.com/repos/gluster/glusterd2/stargazers","contributors_url":"https://api.github.com/repos/gluster/glusterd2/contributors","subscribers_url":"https://api.github.com/repos/gluster/glusterd2/subscribers","subscription_url":"https://api.github.com/repos/gluster/glusterd2/subscription","commits_url":"https://api.github.com/repos/gluster/glusterd2/commits{/sha}","git_commits_url":"https://api.github.com/repos/gluster/glusterd2/git/commits{/sha}","comments_url":"https://api.github.com/repos/gluster/glusterd2/comments{/number}","issue_comment_url":"https://api.github.com/repos/gluster/glusterd2/issues/comments{/number}","contents_url":"https://api.github.com/repos/gluster/glusterd2/contents/{+path}","compare_url":"https://api.github.com/repos/gluster/glusterd2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gluster/glusterd2/merges","archive_url":"https://api.github.com/repos/gluster/glusterd2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gluster/glusterd2/downloads","issues_url":"https://api.github.com/repos/gluster/glusterd2/issues{/number}","pulls_url":"https://api.github.com/repos/gluster/glusterd2/pulls{/number}","milestones_url":"https://api.github.com/repos/gluster/glusterd2/milestones{/number}","notifications_url":"https://api.github.com/repos/gluster/glusterd2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gluster/glusterd2/labels{/name}","releases_url":"https://api.github.com/repos/gluster/glusterd2/releases{/id}","deployments_url":"https://api.github.com/repos/gluster/glusterd2/deployments","created_at":"2014-09-23T12:02:13Z","updated_at":"2018-06-20T10:51:36Z","pushed_at":"2018-06-21T05:56:14Z","git_url":"git://github.com/gluster/glusterd2.git","ssh_url":"git@github.com:gluster/glusterd2.git","clone_url":"https://github.com/gluster/glusterd2.git","svn_url":"https://github.com/gluster/glusterd2","homepage":"","size":12568,"stargazers_count":91,"watchers_count":91,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"archived":false,"open_issues_count":156,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":56,"open_issues":156,"watchers":91,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/615"},"html":{"href":"https://github.com/gluster/glusterd2/pull/615"},"issue":{"href":"https://api.github.com/repos/gluster/glusterd2/issues/615"},"comments":{"href":"https://api.github.com/repos/gluster/glusterd2/issues/615/comments"},"review_comments":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/615/comments"},"review_comment":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gluster/glusterd2/pulls/615/commits"},"statuses":{"href":"https://api.github.com/repos/gluster/glusterd2/statuses/96b6756f82d7f6dfb2714f4fceaac42e768eb3f4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"harigowtham"}}