{"action":"closed","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcsfuse/issues/21","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcsfuse/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcsfuse/issues/21/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcsfuse/issues/21/events","html_url":"https://github.com/GoogleCloudPlatform/gcsfuse/issues/21","id":64102006,"number":21,"title":"Document the dance needed for mmap durability guarantees","user":{"login":"jacobsa","id":202895,"avatar_url":"https://avatars.githubusercontent.com/u/202895?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobsa","html_url":"https://github.com/jacobsa","followers_url":"https://api.github.com/users/jacobsa/followers","following_url":"https://api.github.com/users/jacobsa/following{/other_user}","gists_url":"https://api.github.com/users/jacobsa/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobsa/subscriptions","organizations_url":"https://api.github.com/users/jacobsa/orgs","repos_url":"https://api.github.com/users/jacobsa/repos","events_url":"https://api.github.com/users/jacobsa/events{/privacy}","received_events_url":"https://api.github.com/users/jacobsa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jacobsa","id":202895,"avatar_url":"https://avatars.githubusercontent.com/u/202895?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobsa","html_url":"https://github.com/jacobsa","followers_url":"https://api.github.com/users/jacobsa/followers","following_url":"https://api.github.com/users/jacobsa/following{/other_user}","gists_url":"https://api.github.com/users/jacobsa/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobsa/subscriptions","organizations_url":"https://api.github.com/users/jacobsa/orgs","repos_url":"https://api.github.com/users/jacobsa/repos","events_url":"https://api.github.com/users/jacobsa/events{/privacy}","received_events_url":"https://api.github.com/users/jacobsa/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcsfuse/milestones/1","html_url":"https://github.com/GoogleCloudPlatform/gcsfuse/milestones/beta","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcsfuse/milestones/1/labels","id":1030190,"number":1,"title":"beta","description":null,"creator":{"login":"jacobsa","id":202895,"avatar_url":"https://avatars.githubusercontent.com/u/202895?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobsa","html_url":"https://github.com/jacobsa","followers_url":"https://api.github.com/users/jacobsa/followers","following_url":"https://api.github.com/users/jacobsa/following{/other_user}","gists_url":"https://api.github.com/users/jacobsa/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobsa/subscriptions","organizations_url":"https://api.github.com/users/jacobsa/orgs","repos_url":"https://api.github.com/users/jacobsa/repos","events_url":"https://api.github.com/users/jacobsa/events{/privacy}","received_events_url":"https://api.github.com/users/jacobsa/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":6,"state":"open","created_at":"2015-03-19T23:14:49Z","updated_at":"2015-04-01T02:31:08Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-03-24T21:19:28Z","updated_at":"2015-04-01T02:31:08Z","closed_at":"2015-04-01T02:31:08Z","body":"docs/semantics.md should include a section about how to safely modify mmap'd files, such that the modifications are made durable (and the user sees an error otherwise).\r\n\r\nThere is a novel written about this in the [documentation](http://godoc.org/github.com/jacobsa/fuse/fuseops#FlushFileOp) for `fuseops.FlushFileOp`. Summary: if the user wants to have this work on both OS X and Linux, they should:\r\n\r\n* Call msync(2) with the `MS_SYNC` flag.\r\n* Call munmap(2) for the mapping.\r\n* Call close(2) for the original file descriptor.\r\n\r\n(checking for errors on all calls.)\r\n\r\nThis can probably be relaxed in various ways on Linux and/or OS X, but I'm relatively confident this particular dance works (and jacobsa/fuse contains a test for it)."}}