{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4185","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4185/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4185/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4185/events","html_url":"https://github.com/zfsonlinux/zfs/issues/4185","id":125672466,"number":4185,"title":"zpl_inode.c:zpl_lookup fails to set flags required to return the CI name of zfs snapshot dirs","user":{"login":"RichardSharpe","id":947462,"avatar_url":"https://avatars.githubusercontent.com/u/947462?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardSharpe","html_url":"https://github.com/RichardSharpe","followers_url":"https://api.github.com/users/RichardSharpe/followers","following_url":"https://api.github.com/users/RichardSharpe/following{/other_user}","gists_url":"https://api.github.com/users/RichardSharpe/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardSharpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardSharpe/subscriptions","organizations_url":"https://api.github.com/users/RichardSharpe/orgs","repos_url":"https://api.github.com/users/RichardSharpe/repos","events_url":"https://api.github.com/users/RichardSharpe/events{/privacy}","received_events_url":"https://api.github.com/users/RichardSharpe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2016-01-08T19:02:44Z","updated_at":"2016-01-19T14:07:16Z","closed_at":null,"body":"Hi,\r\n\r\nAfter we fixed the case-insensitive rename issue, we ran into a snapshot issue.\r\n\r\nzfs_dirlook is failing to fill in the pathname if it is a fake .zfs snapshot dir.\r\n\r\nThe fix seems to be:\r\n```\r\ndiff --git a/module/zfs/zfs_dir.c b/module/zfs/zfs_dir.c\r\nindex 712cb46..ced8ee6 100644\r\n--- a/module/zfs/zfs_dir.c\r\n+++ b/module/zfs/zfs_dir.c\r\n@@ -436,6 +436,8 @@ zfs_dirlook(znode_t *dzp, char *name, struct inode\r\n**ipp, int flags,\r\n                rw_exit(&dzp->z_parent_lock);\r\n        } else if (zfs_has_ctldir(dzp) && strcmp(name, ZFS_CTLDIR_NAME) == 0) {\r\n                *ipp = zfsctl_root(dzp);\r\n+                if (rpnp)\r\n+                        (void) strlcpy(rpnp->pn_buf, ZFS_CTLDIR_NAME, rpnp->pn_bufsize);\r\n        } else {\r\n                int zf;\r\n```"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/172863684","html_url":"https://github.com/zfsonlinux/zfs/issues/4185#issuecomment-172863684","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4185","id":172863684,"user":{"login":"RichardSharpe","id":947462,"avatar_url":"https://avatars.githubusercontent.com/u/947462?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardSharpe","html_url":"https://github.com/RichardSharpe","followers_url":"https://api.github.com/users/RichardSharpe/followers","following_url":"https://api.github.com/users/RichardSharpe/following{/other_user}","gists_url":"https://api.github.com/users/RichardSharpe/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardSharpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardSharpe/subscriptions","organizations_url":"https://api.github.com/users/RichardSharpe/orgs","repos_url":"https://api.github.com/users/RichardSharpe/repos","events_url":"https://api.github.com/users/RichardSharpe/events{/privacy}","received_events_url":"https://api.github.com/users/RichardSharpe/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T14:07:16Z","updated_at":"2016-01-19T14:07:16Z","body":"I have tested both the only returning NULL approach and the approach above.\r\n\r\nThe test I use is:\r\n\r\n1. ls some-file.txt # This should return ENOENT when it does not exist.\r\n2. touch Some-file.txt # Create a file with a name differing only by the case of the first char\r\n3. ls some-file.txt\r\n\r\nIf the first step created a negative entry in the dcache, step 3 will fail with ENOENT when it should not.\r\n\r\nReturning NULL seems to cause ENOENT in step 3, while doing as above seems to work.\r\n\r\nI will post the full patch I am now using."}}