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 from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux