[kata-dev] [Announce] virtio-fs released with Kata Containers support
Vivek Goyal
vgoyal at redhat.com
Thu Jan 10 15:57:01 UTC 2019
On Thu, Dec 27, 2018 at 10:57:21AM +0800, jiangyiwen wrote:
[..]
> what do I mean by "I filter O_DIRECT flag in libfuse-daemon"?
>
> I modify passthrough_ll.c code and ignore O_DIRECT flag when opening file,
> then it return success. The codes as follows:
> diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c
> index 3e37dbd..9edb5bb 100644
> --- a/example/passthrough_ll.c
> +++ b/example/passthrough_ll.c
> @@ -1234,7 +1234,7 @@ static void lo_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi)
> fi->flags &= ~O_APPEND;
>
> sprintf(buf, "/proc/self/fd/%i", lo_fd(req, ino));
> - fd = open(buf, fi->flags & ~O_NOFOLLOW);
> + fd = open(buf, fi->flags & ~(O_NOFOLLOW | O_DIRECT));
> if (fd == -1)
> return (void) fuse_reply_err(req, errno);
Hi Yiwen,
Ok, this issue is now fixed. We still do not ignore O_DIRECT flag on host.
I think if file is opened with O_DIRECT in guest, then it makes sense to
open with O_DIRECT on host as well.
We were getting -EINVAL (-22) due to misaligned buffers. We were creating
extra data copy in libfuse daemon and that copy created misalignment.
David Gilbert has now fixed it. He has got rid of that extra copy and
that means if guest hands over aligned buffers, I/O should succeed. This
should also result in some speed up on write path as one extra copy has
been avoided.
These fixes are still internal. David might push these externally soon.
Thanks
Vivek
More information about the kata-dev
mailing list