{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4276","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4276/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4276/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4276/events","html_url":"https://github.com/zfsonlinux/zfs/pull/4276","id":128985926,"number":4276,"title":"[RFC/WIP] Add support for O_TMPFILE","user":{"login":"tuxoko","id":119672,"avatar_url":"https://avatars.githubusercontent.com/u/119672?v=3","gravatar_id":"","url":"https://api.github.com/users/tuxoko","html_url":"https://github.com/tuxoko","followers_url":"https://api.github.com/users/tuxoko/followers","following_url":"https://api.github.com/users/tuxoko/following{/other_user}","gists_url":"https://api.github.com/users/tuxoko/gists{/gist_id}","starred_url":"https://api.github.com/users/tuxoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuxoko/subscriptions","organizations_url":"https://api.github.com/users/tuxoko/orgs","repos_url":"https://api.github.com/users/tuxoko/repos","events_url":"https://api.github.com/users/tuxoko/events{/privacy}","received_events_url":"https://api.github.com/users/tuxoko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-27T00:23:27Z","updated_at":"2016-01-28T06:36:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/4276","html_url":"https://github.com/zfsonlinux/zfs/pull/4276","diff_url":"https://github.com/zfsonlinux/zfs/pull/4276.diff","patch_url":"https://github.com/zfsonlinux/zfs/pull/4276.patch"},"body":"Linux 3.11 add O_TMPFILE to open(2), which allow creating an unlinked file on\r\nsupported filesystem. It's basically doing open(2) and unlink(2) atomically.\r\n\r\nThe filesystem support is added through i_op->tmpfile. We basically copy the\r\ncreate operation except we get rid of the link and name related stuff and add\r\nthe new node to unlinked set.\r\n\r\nNote that Linux also allow linking to a O_TMPFILE with linkat(2), however this\r\nis not supported even with this patch, and doing so would result in ENOENT.\r\n\r\nSigned-off-by: Chunwei Chen <david.chen@osnexus.com>"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/176011069","html_url":"https://github.com/zfsonlinux/zfs/pull/4276#issuecomment-176011069","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4276","id":176011069,"user":{"login":"ryao","id":1386373,"avatar_url":"https://avatars.githubusercontent.com/u/1386373?v=3","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},"created_at":"2016-01-28T06:36:24Z","updated_at":"2016-01-28T06:36:24Z","body":"I do not think userland developers would appreciate us implementing `O_TMPFILE` support without corresponding `linkat()` support.\r\n\r\nThe man page says that `linkat()` is not supported when `O_EXCL` is passed and supported otherwise. Userland code should expect those semantics and likely has fallbacks for the case where `O_TMPFILE` is not supported. Userland using `O_TMPFILE` with `linkat()` likely would not have a fallback for the case when `O_TMPFILE` without `O_EXCL` works, but linkat() is not supported, which means implementing it this way should cause unnecessary pain. If the VFS let us know when `O_EXCL` is specified, we could support it in that case and return `EOPNOTSUPP` otherwise, but unfortunately, that is not the case."}}