Re: O_DIRECT on tmpfs (again)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 29, 2012 at 05:32:14PM -0800, Hugh Dickins wrote:
> Like you, I'm really hoping someone will join in and say they'd been
> disadvantaged by lack of O_DIRECT on tmpfs: no strong feeling myself.

Not disadvantaged as such, but we have had a workaround in libguestfs
for a very long time.

If you use certain qemu caching modes, then qemu will open the backing
disk file using O_DIRECT.  This breaks if the backing file happens to
be on a tmpfs, which for libguestfs would not be unusual -- we often
make or use temporary disk images for various reasons, and people
sometimes have /tmp on a tmpfs.

In 2009 I added code to libguestfs so that if the underlying
filesystem doesn't support O_DIRECT, then we avoid the troublesome
qemu caching modes.  The code is here:

  https://github.com/libguestfs/libguestfs/blob/master/src/launch.c#L147

Since the workaround exists and has been in use for years, we don't
need tmpfs to change.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]