{"action":"closed","number":42,"pull_request":{"url":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/42","id":192921801,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyOTIxODAx","html_url":"https://github.com/openzfsonwindows/ZFSin/pull/42","diff_url":"https://github.com/openzfsonwindows/ZFSin/pull/42.diff","patch_url":"https://github.com/openzfsonwindows/ZFSin/pull/42.patch","issue_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/42","number":42,"state":"closed","locked":false,"title":"vnode resources need to be deleted","user":{"login":"jheuking","id":39560536,"node_id":"MDQ6VXNlcjM5NTYwNTM2","avatar_url":"https://avatars2.githubusercontent.com/u/39560536?v=4","gravatar_id":"","url":"https://api.github.com/users/jheuking","html_url":"https://github.com/jheuking","followers_url":"https://api.github.com/users/jheuking/followers","following_url":"https://api.github.com/users/jheuking/following{/other_user}","gists_url":"https://api.github.com/users/jheuking/gists{/gist_id}","starred_url":"https://api.github.com/users/jheuking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jheuking/subscriptions","organizations_url":"https://api.github.com/users/jheuking/orgs","repos_url":"https://api.github.com/users/jheuking/repos","events_url":"https://api.github.com/users/jheuking/events{/privacy}","received_events_url":"https://api.github.com/users/jheuking/received_events","type":"User","site_admin":false},"body":"When reading many files and folders (I used a FreeBSD-system-zpool and let the windows explorer search for \"*\" in it) the system panics sporadically in rw_destroy->ExDeleteResourceLite() due to memory corruption (see callstack below).\r\nThe windows driver verifier claims at one point, that a resource variable is reinitialized in vnode_create()->ExInitializeResourceLite((*vpp)->FileHeader.Resource);\r\nThis led me to a short google research for the ExInitializeResourceLite-function. I found [this article](https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/nf-wdm-exinitializeresourcelite) on microsoft docs, which mentions that after the initialization, the ExDeleteResourceLite-function should be called before freeing the memory. But I did not found any reference of this function in the project, which deletes the vnode resources. So I added that in zfs_vnop_reclaim(), which seems to resolve the problem.\r\nIn Addition to that I replaced the obsolete MmGetSystemAddressForMdl-function with MmGetSystemAddressForMdlSafe as it is suggested [here](https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/nf-wdm-mmgetsystemaddressformdl).\r\n\r\n```\r\nnt!ExDeleteResourceLite+0x1558fb\r\n\tZFSin!rw_destroy+0x17 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\spl\\module\\spl\\spl-rwlock.c @ 77]\tC/C++/ASM\r\n \tZFSin!zfs_znode_cache_destructor+0x14e [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_znode.c @ 195]\tC/C++/ASM\r\n \tZFSin!kmem_cache_free_debug+0x328 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\spl\\module\\spl\\spl-kmem.c @ 1706]\tC/C++/ASM\r\n \tZFSin!kmem_cache_free+0x242 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\spl\\module\\spl\\spl-kmem.c @ 2449]\tC/C++/ASM\r\n \tZFSin!zfs_znode_free+0x121 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_znode.c @ 1672]\tC/C++/ASM\r\n \tZFSin!zfs_zinactive+0x14a [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_znode.c @ 1641]\tC/C++/ASM\r\n \tZFSin!zfs_vnop_reclaim+0x194 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_vnops_windows.c @ 1012]\tC/C++/ASM\r\n \tZFSin!vnode_recycle_int+0x1b7 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\spl\\module\\spl\\spl-vnode.c @ 818]\tC/C++/ASM\r\n \tZFSin!vnode_create+0x2a1 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\spl\\module\\spl\\spl-vnode.c @ 893]\tC/C++/ASM\r\n \tZFSin!zfs_znode_getvnode+0xac [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_vnops_windows.c @ 1065]\tC/C++/ASM\r\n \tZFSin!zfs_zget_ext+0x538 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_znode.c @ 1468]\tC/C++/ASM\r\n \tZFSin!zfs_readdir+0xa2a [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_vnops.c @ 2823]\tC/C++/ASM\r\n \tZFSin!query_directory_FileFullDirectoryInformation+0x4fc [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_vnops_windows.c @ 3012]\tC/C++/ASM\r\n \tZFSin!query_directory+0x6c [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_vnops_windows.c @ 3057]\tC/C++/ASM\r\n \tZFSin!fsDispatcher+0x9e7 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_vnops_windows.c @ 4758]\tC/C++/ASM\r\n \tZFSin!dispatcher+0x1b9 [c:\\users\\julianh\\source\\repos\\zfsin\\zfsin\\zfs\\module\\zfs\\zfs_vnops_windows.c @ 4867]\tC/C++/ASM\r\n \tnt!IofCallDriver+0x59\tC/C++/ASM\r\n```","created_at":"2018-06-06T07:22:17Z","updated_at":"2018-06-06T07:44:03Z","closed_at":"2018-06-06T07:44:03Z","merged_at":"2018-06-06T07:44:03Z","merge_commit_sha":"4b3c75c8c71b8e600627b22988033887c266c3ec","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/42/commits","review_comments_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/42/comments","review_comment_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/42/comments","statuses_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/statuses/2c0d4711ee71d7a8c1ef9299e1dcdcf05cf35398","head":{"label":"jheuking:ExDeleteResourceLite_memory_corruption_bug","ref":"ExDeleteResourceLite_memory_corruption_bug","sha":"2c0d4711ee71d7a8c1ef9299e1dcdcf05cf35398","user":{"login":"jheuking","id":39560536,"node_id":"MDQ6VXNlcjM5NTYwNTM2","avatar_url":"https://avatars2.githubusercontent.com/u/39560536?v=4","gravatar_id":"","url":"https://api.github.com/users/jheuking","html_url":"https://github.com/jheuking","followers_url":"https://api.github.com/users/jheuking/followers","following_url":"https://api.github.com/users/jheuking/following{/other_user}","gists_url":"https://api.github.com/users/jheuking/gists{/gist_id}","starred_url":"https://api.github.com/users/jheuking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jheuking/subscriptions","organizations_url":"https://api.github.com/users/jheuking/orgs","repos_url":"https://api.github.com/users/jheuking/repos","events_url":"https://api.github.com/users/jheuking/events{/privacy}","received_events_url":"https://api.github.com/users/jheuking/received_events","type":"User","site_admin":false},"repo":{"id":134829884,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ4Mjk4ODQ=","name":"ZFSin","full_name":"jheuking/ZFSin","owner":{"login":"jheuking","id":39560536,"node_id":"MDQ6VXNlcjM5NTYwNTM2","avatar_url":"https://avatars2.githubusercontent.com/u/39560536?v=4","gravatar_id":"","url":"https://api.github.com/users/jheuking","html_url":"https://github.com/jheuking","followers_url":"https://api.github.com/users/jheuking/followers","following_url":"https://api.github.com/users/jheuking/following{/other_user}","gists_url":"https://api.github.com/users/jheuking/gists{/gist_id}","starred_url":"https://api.github.com/users/jheuking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jheuking/subscriptions","organizations_url":"https://api.github.com/users/jheuking/orgs","repos_url":"https://api.github.com/users/jheuking/repos","events_url":"https://api.github.com/users/jheuking/events{/privacy}","received_events_url":"https://api.github.com/users/jheuking/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jheuking/ZFSin","description":"OpenZFS ports","fork":true,"url":"https://api.github.com/repos/jheuking/ZFSin","forks_url":"https://api.github.com/repos/jheuking/ZFSin/forks","keys_url":"https://api.github.com/repos/jheuking/ZFSin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jheuking/ZFSin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jheuking/ZFSin/teams","hooks_url":"https://api.github.com/repos/jheuking/ZFSin/hooks","issue_events_url":"https://api.github.com/repos/jheuking/ZFSin/issues/events{/number}","events_url":"https://api.github.com/repos/jheuking/ZFSin/events","assignees_url":"https://api.github.com/repos/jheuking/ZFSin/assignees{/user}","branches_url":"https://api.github.com/repos/jheuking/ZFSin/branches{/branch}","tags_url":"https://api.github.com/repos/jheuking/ZFSin/tags","blobs_url":"https://api.github.com/repos/jheuking/ZFSin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jheuking/ZFSin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jheuking/ZFSin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jheuking/ZFSin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jheuking/ZFSin/statuses/{sha}","languages_url":"https://api.github.com/repos/jheuking/ZFSin/languages","stargazers_url":"https://api.github.com/repos/jheuking/ZFSin/stargazers","contributors_url":"https://api.github.com/repos/jheuking/ZFSin/contributors","subscribers_url":"https://api.github.com/repos/jheuking/ZFSin/subscribers","subscription_url":"https://api.github.com/repos/jheuking/ZFSin/subscription","commits_url":"https://api.github.com/repos/jheuking/ZFSin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jheuking/ZFSin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jheuking/ZFSin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jheuking/ZFSin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jheuking/ZFSin/contents/{+path}","compare_url":"https://api.github.com/repos/jheuking/ZFSin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jheuking/ZFSin/merges","archive_url":"https://api.github.com/repos/jheuking/ZFSin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jheuking/ZFSin/downloads","issues_url":"https://api.github.com/repos/jheuking/ZFSin/issues{/number}","pulls_url":"https://api.github.com/repos/jheuking/ZFSin/pulls{/number}","milestones_url":"https://api.github.com/repos/jheuking/ZFSin/milestones{/number}","notifications_url":"https://api.github.com/repos/jheuking/ZFSin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jheuking/ZFSin/labels{/name}","releases_url":"https://api.github.com/repos/jheuking/ZFSin/releases{/id}","deployments_url":"https://api.github.com/repos/jheuking/ZFSin/deployments","created_at":"2018-05-25T08:48:12Z","updated_at":"2018-05-25T08:48:20Z","pushed_at":"2018-06-06T06:57:44Z","git_url":"git://github.com/jheuking/ZFSin.git","ssh_url":"git@github.com:jheuking/ZFSin.git","clone_url":"https://github.com/jheuking/ZFSin.git","svn_url":"https://github.com/jheuking/ZFSin","homepage":null,"size":7732,"stargazers_count":0,"watchers_count":0,"language":"C","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":"openzfsonwindows:master","ref":"master","sha":"b600d88e1f4de20f43e3f4893a4b3ff64a94b00f","user":{"login":"openzfsonwindows","id":33284003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMjg0MDAz","avatar_url":"https://avatars2.githubusercontent.com/u/33284003?v=4","gravatar_id":"","url":"https://api.github.com/users/openzfsonwindows","html_url":"https://github.com/openzfsonwindows","followers_url":"https://api.github.com/users/openzfsonwindows/followers","following_url":"https://api.github.com/users/openzfsonwindows/following{/other_user}","gists_url":"https://api.github.com/users/openzfsonwindows/gists{/gist_id}","starred_url":"https://api.github.com/users/openzfsonwindows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzfsonwindows/subscriptions","organizations_url":"https://api.github.com/users/openzfsonwindows/orgs","repos_url":"https://api.github.com/users/openzfsonwindows/repos","events_url":"https://api.github.com/users/openzfsonwindows/events{/privacy}","received_events_url":"https://api.github.com/users/openzfsonwindows/received_events","type":"Organization","site_admin":false},"repo":{"id":85033083,"node_id":"MDEwOlJlcG9zaXRvcnk4NTAzMzA4Mw==","name":"ZFSin","full_name":"openzfsonwindows/ZFSin","owner":{"login":"openzfsonwindows","id":33284003,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMjg0MDAz","avatar_url":"https://avatars2.githubusercontent.com/u/33284003?v=4","gravatar_id":"","url":"https://api.github.com/users/openzfsonwindows","html_url":"https://github.com/openzfsonwindows","followers_url":"https://api.github.com/users/openzfsonwindows/followers","following_url":"https://api.github.com/users/openzfsonwindows/following{/other_user}","gists_url":"https://api.github.com/users/openzfsonwindows/gists{/gist_id}","starred_url":"https://api.github.com/users/openzfsonwindows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzfsonwindows/subscriptions","organizations_url":"https://api.github.com/users/openzfsonwindows/orgs","repos_url":"https://api.github.com/users/openzfsonwindows/repos","events_url":"https://api.github.com/users/openzfsonwindows/events{/privacy}","received_events_url":"https://api.github.com/users/openzfsonwindows/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openzfsonwindows/ZFSin","description":"OpenZFS ports","fork":false,"url":"https://api.github.com/repos/openzfsonwindows/ZFSin","forks_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/forks","keys_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/teams","hooks_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/hooks","issue_events_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/events{/number}","events_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/events","assignees_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/assignees{/user}","branches_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/branches{/branch}","tags_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/tags","blobs_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/statuses/{sha}","languages_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/languages","stargazers_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/stargazers","contributors_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/contributors","subscribers_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/subscribers","subscription_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/subscription","commits_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/contents/{+path}","compare_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/merges","archive_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/downloads","issues_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues{/number}","pulls_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls{/number}","milestones_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/milestones{/number}","notifications_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/labels{/name}","releases_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/releases{/id}","deployments_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/deployments","created_at":"2017-03-15T05:33:15Z","updated_at":"2018-06-05T15:00:09Z","pushed_at":"2018-06-06T07:44:02Z","git_url":"git://github.com/openzfsonwindows/ZFSin.git","ssh_url":"git@github.com:openzfsonwindows/ZFSin.git","clone_url":"https://github.com/openzfsonwindows/ZFSin.git","svn_url":"https://github.com/openzfsonwindows/ZFSin","homepage":null,"size":7887,"stargazers_count":364,"watchers_count":364,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":22,"license":null,"forks":14,"open_issues":22,"watchers":364,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/42"},"html":{"href":"https://github.com/openzfsonwindows/ZFSin/pull/42"},"issue":{"href":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/42"},"comments":{"href":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openzfsonwindows/ZFSin/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/openzfsonwindows/ZFSin/statuses/2c0d4711ee71d7a8c1ef9299e1dcdcf05cf35398"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"lundman","id":637168,"node_id":"MDQ6VXNlcjYzNzE2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/637168?v=4","gravatar_id":"","url":"https://api.github.com/users/lundman","html_url":"https://github.com/lundman","followers_url":"https://api.github.com/users/lundman/followers","following_url":"https://api.github.com/users/lundman/following{/other_user}","gists_url":"https://api.github.com/users/lundman/gists{/gist_id}","starred_url":"https://api.github.com/users/lundman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lundman/subscriptions","organizations_url":"https://api.github.com/users/lundman/orgs","repos_url":"https://api.github.com/users/lundman/repos","events_url":"https://api.github.com/users/lundman/events{/privacy}","received_events_url":"https://api.github.com/users/lundman/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":8,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"lundman"}}