{"action":"created","comment":{"url":"https://api.github.com/repos/stratis-storage/stratisd/pulls/comments/128881955","pull_request_review_id":51608149,"id":128881955,"diff_hunk":"@@ -184,13 +184,14 @@ impl StaticHeader {\n \n \n     /// Read data from f into buffer of length _BDA_STATIC_HDR_SIZE.\n-    fn read_into_buf<F>(f: &mut F) -> EngineResult<[u8; _BDA_STATIC_HDR_SIZE]>\n+    /// Return a newly constructed buffer and the number of bytes read.\n+    fn read_into_buf<F>(f: &mut F) -> EngineResult<([u8; _BDA_STATIC_HDR_SIZE], usize)>\n         where F: Read + Seek\n     {\n         try!(f.seek(SeekFrom::Start(0)));\n         let mut buf = [0u8; _BDA_STATIC_HDR_SIZE];\n-        try!(f.read(&mut buf));\n-        Ok(buf)\n+        let bytes = try!(f.read(&mut buf));","path":"src/engine/strat_engine/metadata.rs","position":null,"original_position":13,"commit_id":"87dbb8500ab8f2ee9b115f08c01bc7281b229935","original_commit_id":"91a450752a1c2c474a9536eb5d0e70eefe699f84","user":{"login":"agrover","id":2305,"avatar_url":"https://avatars1.githubusercontent.com/u/2305?v=4","gravatar_id":"","url":"https://api.github.com/users/agrover","html_url":"https://github.com/agrover","followers_url":"https://api.github.com/users/agrover/followers","following_url":"https://api.github.com/users/agrover/following{/other_user}","gists_url":"https://api.github.com/users/agrover/gists{/gist_id}","starred_url":"https://api.github.com/users/agrover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrover/subscriptions","organizations_url":"https://api.github.com/users/agrover/orgs","repos_url":"https://api.github.com/users/agrover/repos","events_url":"https://api.github.com/users/agrover/events{/privacy}","received_events_url":"https://api.github.com/users/agrover/received_events","type":"User","site_admin":false},"body":"Match on read_into_buf returning Err in determine_ownership and return DevOwnership::Theirs instead?\r\n\r\nIf you do stick with this PR's current approach, it really is a change from \"read all expected bytes into a buffer or fail\" semantics to \"read as much as I can and return that\", yes? If so, it's likely that functions shouldn't be taking or returning fixed size arrays any longer, but Vec<u8>s and slices, which track their own length. Shouldn't need `bytes`, instead just call `.len()` on the vec or slice.","created_at":"2017-07-22T00:03:22Z","updated_at":"2017-07-22T00:03:23Z","html_url":"https://github.com/stratis-storage/stratisd/pull/476#discussion_r128881955","pull_request_url":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476","_links":{"self":{"href":"https://api.github.com/repos/stratis-storage/stratisd/pulls/comments/128881955"},"html":{"href":"https://github.com/stratis-storage/stratisd/pull/476#discussion_r128881955"},"pull_request":{"href":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476"}}},"pull_request":{"url":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476","id":131578098,"html_url":"https://github.com/stratis-storage/stratisd/pull/476","diff_url":"https://github.com/stratis-storage/stratisd/pull/476.diff","patch_url":"https://github.com/stratis-storage/stratisd/pull/476.patch","issue_url":"https://api.github.com/repos/stratis-storage/stratisd/issues/476","number":476,"state":"open","locked":false,"title":"Some metadata improvements","user":{"login":"mulkieran","id":1218366,"avatar_url":"https://avatars0.githubusercontent.com/u/1218366?v=4","gravatar_id":"","url":"https://api.github.com/users/mulkieran","html_url":"https://github.com/mulkieran","followers_url":"https://api.github.com/users/mulkieran/followers","following_url":"https://api.github.com/users/mulkieran/following{/other_user}","gists_url":"https://api.github.com/users/mulkieran/gists{/gist_id}","starred_url":"https://api.github.com/users/mulkieran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulkieran/subscriptions","organizations_url":"https://api.github.com/users/mulkieran/orgs","repos_url":"https://api.github.com/users/mulkieran/repos","events_url":"https://api.github.com/users/mulkieran/events{/privacy}","received_events_url":"https://api.github.com/users/mulkieran/received_events","type":"User","site_admin":false},"body":"This PR does the following:\r\n\r\n* Adds some more tests.\r\n* Fixes a bug in ```MDARegions::initialize()```.\r\n* Improves StaticHeader implementation by abstracting some methods, simplifying some others, and refining ```sigblock_from_buf()``` so that it takes into account the possibility of a partial read.\r\n* Improves ```MDARegions::load()``` by having it return an error if there is truly an error in reading an MDA region.\r\n* Gets rid of one TODO.\r\n* Gets rid of two clippy errors.","created_at":"2017-07-20T15:05:56Z","updated_at":"2017-07-22T00:03:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d0ccc6feb47c1651b145e918bb3a0b3e799795f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476/commits","review_comments_url":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476/comments","review_comment_url":"https://api.github.com/repos/stratis-storage/stratisd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stratis-storage/stratisd/issues/476/comments","statuses_url":"https://api.github.com/repos/stratis-storage/stratisd/statuses/87dbb8500ab8f2ee9b115f08c01bc7281b229935","head":{"label":"mulkieran:master-read-exact","ref":"master-read-exact","sha":"87dbb8500ab8f2ee9b115f08c01bc7281b229935","user":{"login":"mulkieran","id":1218366,"avatar_url":"https://avatars0.githubusercontent.com/u/1218366?v=4","gravatar_id":"","url":"https://api.github.com/users/mulkieran","html_url":"https://github.com/mulkieran","followers_url":"https://api.github.com/users/mulkieran/followers","following_url":"https://api.github.com/users/mulkieran/following{/other_user}","gists_url":"https://api.github.com/users/mulkieran/gists{/gist_id}","starred_url":"https://api.github.com/users/mulkieran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulkieran/subscriptions","organizations_url":"https://api.github.com/users/mulkieran/orgs","repos_url":"https://api.github.com/users/mulkieran/repos","events_url":"https://api.github.com/users/mulkieran/events{/privacy}","received_events_url":"https://api.github.com/users/mulkieran/received_events","type":"User","site_admin":false},"repo":{"id":66955005,"name":"stratisd","full_name":"mulkieran/stratisd","owner":{"login":"mulkieran","id":1218366,"avatar_url":"https://avatars0.githubusercontent.com/u/1218366?v=4","gravatar_id":"","url":"https://api.github.com/users/mulkieran","html_url":"https://github.com/mulkieran","followers_url":"https://api.github.com/users/mulkieran/followers","following_url":"https://api.github.com/users/mulkieran/following{/other_user}","gists_url":"https://api.github.com/users/mulkieran/gists{/gist_id}","starred_url":"https://api.github.com/users/mulkieran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulkieran/subscriptions","organizations_url":"https://api.github.com/users/mulkieran/orgs","repos_url":"https://api.github.com/users/mulkieran/repos","events_url":"https://api.github.com/users/mulkieran/events{/privacy}","received_events_url":"https://api.github.com/users/mulkieran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mulkieran/stratisd","description":null,"fork":true,"url":"https://api.github.com/repos/mulkieran/stratisd","forks_url":"https://api.github.com/repos/mulkieran/stratisd/forks","keys_url":"https://api.github.com/repos/mulkieran/stratisd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mulkieran/stratisd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mulkieran/stratisd/teams","hooks_url":"https://api.github.com/repos/mulkieran/stratisd/hooks","issue_events_url":"https://api.github.com/repos/mulkieran/stratisd/issues/events{/number}","events_url":"https://api.github.com/repos/mulkieran/stratisd/events","assignees_url":"https://api.github.com/repos/mulkieran/stratisd/assignees{/user}","branches_url":"https://api.github.com/repos/mulkieran/stratisd/branches{/branch}","tags_url":"https://api.github.com/repos/mulkieran/stratisd/tags","blobs_url":"https://api.github.com/repos/mulkieran/stratisd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mulkieran/stratisd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mulkieran/stratisd/git/refs{/sha}","trees_url":"https://api.github.com/repos/mulkieran/stratisd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mulkieran/stratisd/statuses/{sha}","languages_url":"https://api.github.com/repos/mulkieran/stratisd/languages","stargazers_url":"https://api.github.com/repos/mulkieran/stratisd/stargazers","contributors_url":"https://api.github.com/repos/mulkieran/stratisd/contributors","subscribers_url":"https://api.github.com/repos/mulkieran/stratisd/subscribers","subscription_url":"https://api.github.com/repos/mulkieran/stratisd/subscription","commits_url":"https://api.github.com/repos/mulkieran/stratisd/commits{/sha}","git_commits_url":"https://api.github.com/repos/mulkieran/stratisd/git/commits{/sha}","comments_url":"https://api.github.com/repos/mulkieran/stratisd/comments{/number}","issue_comment_url":"https://api.github.com/repos/mulkieran/stratisd/issues/comments{/number}","contents_url":"https://api.github.com/repos/mulkieran/stratisd/contents/{+path}","compare_url":"https://api.github.com/repos/mulkieran/stratisd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mulkieran/stratisd/merges","archive_url":"https://api.github.com/repos/mulkieran/stratisd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mulkieran/stratisd/downloads","issues_url":"https://api.github.com/repos/mulkieran/stratisd/issues{/number}","pulls_url":"https://api.github.com/repos/mulkieran/stratisd/pulls{/number}","milestones_url":"https://api.github.com/repos/mulkieran/stratisd/milestones{/number}","notifications_url":"https://api.github.com/repos/mulkieran/stratisd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mulkieran/stratisd/labels{/name}","releases_url":"https://api.github.com/repos/mulkieran/stratisd/releases{/id}","deployments_url":"https://api.github.com/repos/mulkieran/stratisd/deployments","created_at":"2016-08-30T15:46:29Z","updated_at":"2016-09-28T12:45:43Z","pushed_at":"2017-07-21T19:44:43Z","git_url":"git://github.com/mulkieran/stratisd.git","ssh_url":"git@github.com:mulkieran/stratisd.git","clone_url":"https://github.com/mulkieran/stratisd.git","svn_url":"https://github.com/mulkieran/stratisd","homepage":null,"size":1145,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"stratis-storage:master","ref":"master","sha":"3d495011e7ae9a38a98680eaa75d7dc73ddc53ce","user":{"login":"stratis-storage","id":21202300,"avatar_url":"https://avatars2.githubusercontent.com/u/21202300?v=4","gravatar_id":"","url":"https://api.github.com/users/stratis-storage","html_url":"https://github.com/stratis-storage","followers_url":"https://api.github.com/users/stratis-storage/followers","following_url":"https://api.github.com/users/stratis-storage/following{/other_user}","gists_url":"https://api.github.com/users/stratis-storage/gists{/gist_id}","starred_url":"https://api.github.com/users/stratis-storage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratis-storage/subscriptions","organizations_url":"https://api.github.com/users/stratis-storage/orgs","repos_url":"https://api.github.com/users/stratis-storage/repos","events_url":"https://api.github.com/users/stratis-storage/events{/privacy}","received_events_url":"https://api.github.com/users/stratis-storage/received_events","type":"Organization","site_admin":false},"repo":{"id":66564704,"name":"stratisd","full_name":"stratis-storage/stratisd","owner":{"login":"stratis-storage","id":21202300,"avatar_url":"https://avatars2.githubusercontent.com/u/21202300?v=4","gravatar_id":"","url":"https://api.github.com/users/stratis-storage","html_url":"https://github.com/stratis-storage","followers_url":"https://api.github.com/users/stratis-storage/followers","following_url":"https://api.github.com/users/stratis-storage/following{/other_user}","gists_url":"https://api.github.com/users/stratis-storage/gists{/gist_id}","starred_url":"https://api.github.com/users/stratis-storage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stratis-storage/subscriptions","organizations_url":"https://api.github.com/users/stratis-storage/orgs","repos_url":"https://api.github.com/users/stratis-storage/repos","events_url":"https://api.github.com/users/stratis-storage/events{/privacy}","received_events_url":"https://api.github.com/users/stratis-storage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stratis-storage/stratisd","description":null,"fork":false,"url":"https://api.github.com/repos/stratis-storage/stratisd","forks_url":"https://api.github.com/repos/stratis-storage/stratisd/forks","keys_url":"https://api.github.com/repos/stratis-storage/stratisd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stratis-storage/stratisd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stratis-storage/stratisd/teams","hooks_url":"https://api.github.com/repos/stratis-storage/stratisd/hooks","issue_events_url":"https://api.github.com/repos/stratis-storage/stratisd/issues/events{/number}","events_url":"https://api.github.com/repos/stratis-storage/stratisd/events","assignees_url":"https://api.github.com/repos/stratis-storage/stratisd/assignees{/user}","branches_url":"https://api.github.com/repos/stratis-storage/stratisd/branches{/branch}","tags_url":"https://api.github.com/repos/stratis-storage/stratisd/tags","blobs_url":"https://api.github.com/repos/stratis-storage/stratisd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stratis-storage/stratisd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stratis-storage/stratisd/git/refs{/sha}","trees_url":"https://api.github.com/repos/stratis-storage/stratisd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stratis-storage/stratisd/statuses/{sha}","languages_url":"https://api.github.com/repos/stratis-storage/stratisd/languages","stargazers_url":"https://api.github.com/repos/stratis-storage/stratisd/stargazers","contributors_url":"https://api.github.com/repos/stratis-storage/stratisd/contributors","subscribers_url":"https://api.github.com/repos/stratis-storage/stratisd/subscribers","subscription_url":"https://api.github.com/repos/stratis-storage/stratisd/subscription","commits_url":"https://api.github.com/repos/stratis-storage/stratisd/commits{/sha}","git_commits_url":"https://api.github.com/repos/stratis-storage/stratisd/git/commits{/sha}","comments_url":"https://api.github.com/repos/stratis-storage/stratisd/comments{/number}","issue_comment_url":"https://api.github.com/repos/stratis-storage/stratisd/issues/comments{/number}","contents_url":"https://api.github.com/repos/stratis-storage/stratisd/contents/{+path}","compare_url":"https://api.github.com/repos/stratis-storage/stratisd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stratis-storage/stratisd/merges","archive_url":"https://api.github.com/repos/stratis-storage/stratisd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stratis-storage/stratisd/downloads","issues_url":"https://api.github.com/repos/stratis-storage/stratisd/issues{/number}","pulls_url":"https://api.github.com/repos/stratis-storage/stratisd/pulls{/number}","milestones_url":"https://api.github.com/repos/stratis-storage/stratisd/milestones{/number}","notifications_url":"https://api.github.com/repos/stratis-storage/stratisd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stratis-storage/stratisd/labels{/name}","releases_url":"https://api.github.com/repos/stratis-storage/stratisd/releases{/id}","deployments_url":"https://api.github.com/repos/stratis-storage/stratisd/deployments","created_at":"2016-08-25T14:24:19Z","updated_at":"2017-04-01T13:57:16Z","pushed_at":"2017-07-21T21:25:35Z","git_url":"git://github.com/stratis-storage/stratisd.git","ssh_url":"git@github.com:stratis-storage/stratisd.git","clone_url":"https://github.com/stratis-storage/stratisd.git","svn_url":"https://github.com/stratis-storage/stratisd","homepage":null,"size":1103,"stargazers_count":3,"watchers_count":3,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":66,"forks":4,"open_issues":66,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476"},"html":{"href":"https://github.com/stratis-storage/stratisd/pull/476"},"issue":{"href":"https://api.github.com/repos/stratis-storage/stratisd/issues/476"},"comments":{"href":"https://api.github.com/repos/stratis-storage/stratisd/issues/476/comments"},"review_comments":{"href":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476/comments"},"review_comment":{"href":"https://api.github.com/repos/stratis-storage/stratisd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stratis-storage/stratisd/pulls/476/commits"},"statuses":{"href":"https://api.github.com/repos/stratis-storage/stratisd/statuses/87dbb8500ab8f2ee9b115f08c01bc7281b229935"}}}}
{"actor":{"display_login":"agrover"}}