[Virtio-fs] [PATCH V2] virtiofsd: Reset O_DIRECT flag during file open

Stefan Hajnoczi stefanha at redhat.com
Thu Aug 22 13:15:11 UTC 2019


On Tue, Aug 20, 2019 at 02:37:46PM -0400, Vivek Goyal wrote:
> If an application wants to do direct IO and opens a file with O_DIRECT
> in guest, that does not necessarily mean that we need to bypass page
> cache on host as well. So reset this flag on host.
> 
> If somebody needs to bypass page cache on host as well (and it is safe to
> do so), we can add a knob in daemon later to control this behavior.
> 
> I check virtio-9p and they do reset O_DIRECT flag.
> 
> Signed-off-by: Vivek Goyal <vgoyal at redhat.com>
> ---
>  contrib/virtiofsd/passthrough_ll.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)

virtio-fs should work even if the host file system doesn't support
O_DIRECT:

Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virtio-fs/attachments/20190822/0a7276d6/attachment.sig>


More information about the Virtio-fs mailing list