{"action":"opened","issue":{"url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/78","repository_url":"https://api.github.com/repos/openzfsonwindows/ZFSin","labels_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/78/comments","events_url":"https://api.github.com/repos/openzfsonwindows/ZFSin/issues/78/events","html_url":"https://github.com/openzfsonwindows/ZFSin/issues/78","id":373929233,"node_id":"MDU6SXNzdWUzNzM5MjkyMzM=","number":78,"title":"There is some label offset miscalculation","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-25T12:45:54Z","updated_at":"2018-10-25T12:45:54Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"As we now get the right size from `GetFileDriveSize();` we can also read the vdev label properly ... 🎉  \r\nbut that revealed some problems with the label offset calculation and in addition to that we create configs now that we shouldn't create.\r\n\r\n1. Currently we read the partition labels at the end of the partition at partition offset + drivesize, which is far behind the disk in most cases. So we never find anything valid there. \r\n\r\n2. We are now able to find the partition label at the end of the disk, which leads to a problem. \r\nStarting from a device that has one ZFS partition with a zpool we basically go through the devices like that:\r\n```\r\nforeach dev that SetupDiEnumDeviceInterfaces throws at us{\r\nadd as potential device to avltree slice_cache\r\n\r\ndoes this device has partitions that could contain a zpool? \r\nYES? Then add the device again to slice_cache with partition information hacked into dev name\r\n}\r\n\r\nok, we have some configs\r\nnow check which could be ZFS pools, i.e. read the vdev label and do some other checking..\r\n```\r\nand now comes the cool stuff\r\nas we found valid vdev label on the whole disk AND on the partition we take both configuration as valid.\r\nI don't know if this is the way it should work, but I guess it's not :smile:\r\nthe problem occurs here, because we have a valid configuration (from the whole disk) that doesn't contain the partition offset hack, so the driver aborts afterwards.\r\nBefore we added the fix for GetFileDriveSize() there weren't able to read any label for the whole disk so that was ignored and everything worked as expected..\r\nSo yeah... I'm not sure how to solve this the best way.\r\n\r\nBut I would suggest to just allow configs, which include the hack in the device path. That would currently limit us to only use zpools on partitions. But importing a zpool that is directly embedded in a disk, crashed the driver anyways in my case... "}}
{"actor":{"display_login":"jheuking"}}