{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5292","repository_url":"https://api.github.com/repos/zfsonlinux/zfs","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5292/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5292/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5292/events","html_url":"https://github.com/zfsonlinux/zfs/issues/5292","id":183506970,"number":5292,"title":"kstat collisions from pool names","user":{"login":"ryao","id":1386373,"avatar_url":"https://avatars2.githubusercontent.com/u/1386373?v=4","gravatar_id":"","url":"https://api.github.com/users/ryao","html_url":"https://github.com/ryao","followers_url":"https://api.github.com/users/ryao/followers","following_url":"https://api.github.com/users/ryao/following{/other_user}","gists_url":"https://api.github.com/users/ryao/gists{/gist_id}","starred_url":"https://api.github.com/users/ryao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryao/subscriptions","organizations_url":"https://api.github.com/users/ryao/orgs","repos_url":"https://api.github.com/users/ryao/repos","events_url":"https://api.github.com/users/ryao/events{/privacy}","received_events_url":"https://api.github.com/users/ryao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-10-17T19:36:09Z","updated_at":"2017-07-24T17:54:18Z","closed_at":null,"body":"It dawns on me that this is potentially problematic:\n\n```\n/proc/spl/kstat/zfs/fm\n/proc/spl/kstat/zfs/zil\n/proc/spl/kstat/zfs/dbufs\n/proc/spl/kstat/zfs/rpool\n/proc/spl/kstat/zfs/rpool/io\n/proc/spl/kstat/zfs/rpool/txgs\n/proc/spl/kstat/zfs/rpool/reads\n/proc/spl/kstat/zfs/rpool/dmu_tx_assign\n/proc/spl/kstat/zfs/dbgmsg\n/proc/spl/kstat/zfs/dmu_tx\n/proc/spl/kstat/zfs/arcstats\n/proc/spl/kstat/zfs/xuio_stats\n/proc/spl/kstat/zfs/zfetchstats\n/proc/spl/kstat/zfs/vdev_cache_stats\n```\n\nIn specific, what happens if the pool named `rpool` was named `zil` or one of those other kstats? Things collide. I haven't tried this on a live system to see what happens yet, but I can imagine no way of handling a collision here that I like.\n\nI think we should change `(void) snprintf(name, KSTAT_STRLEN, \"zfs/%s\", spa_name(spa));` to `(void) snprintf(name, KSTAT_STRLEN, \"zfs/pool/%s\", spa_name(spa));` in `spa_tx_assign_init()`. This avoids collisions. I am opening this issue to hear if anyone is opposed to this change.\n"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/317503009","html_url":"https://github.com/zfsonlinux/zfs/issues/5292#issuecomment-317503009","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/5292","id":317503009,"user":{"login":"behlendorf","id":148917,"avatar_url":"https://avatars2.githubusercontent.com/u/148917?v=4","gravatar_id":"","url":"https://api.github.com/users/behlendorf","html_url":"https://github.com/behlendorf","followers_url":"https://api.github.com/users/behlendorf/followers","following_url":"https://api.github.com/users/behlendorf/following{/other_user}","gists_url":"https://api.github.com/users/behlendorf/gists{/gist_id}","starred_url":"https://api.github.com/users/behlendorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behlendorf/subscriptions","organizations_url":"https://api.github.com/users/behlendorf/orgs","repos_url":"https://api.github.com/users/behlendorf/repos","events_url":"https://api.github.com/users/behlendorf/events{/privacy}","received_events_url":"https://api.github.com/users/behlendorf/received_events","type":"User","site_admin":false},"created_at":"2017-07-24T17:54:18Z","updated_at":"2017-07-24T17:54:18Z","body":"@loli10K's kstat collision detection patch was merged.  I'm leaving this issue open until a more complete long term solution can be implemented."}}
{"actor":{"display_login":"behlendorf"}}