hw/9pfs: Remove O_NOATIME flag from 9pfs open() calls in readonly mode
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 16 Jan 2012 18:11:40 +0000 (18:11 +0000)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 30 Jan 2012 05:24:17 +0000 (10:54 +0530)
When 2c74c2cb4bedddbfa67628fbd5f9273b4e0e9903 added support for
the 'readonly' flag against 9p filesystems, it also made QEMU
add the O_NOATIME flag as a side-effect.

The O_NOATIME flag, however, may only be set by the file owner,
or a user with CAP_FOWNER capability.  QEMU cannot assume that
this is the case for filesytems exported to QEMU.

eg, run QEMU as non-root, and attempt to pass the host OS
filesystem through to the guest OS with readonly enable.
The result is that the guest OS cannot open any files at
all.

If O_NOATIME is really required, it should be optionally
enabled via a separate QEMU command line flag.

 * hw/9pfs/virtio-9p.c: Remove O_NOATIME

Acked-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs/virtio-9p.c

index dfe2025ed29c22f978ddd48774eb1086fbcd56df..a72ffc3390ae4953927d240f93c652f13e123efb 100644 (file)
@@ -1391,7 +1391,6 @@ static void v9fs_open(void *opaque)
                 err = -EROFS;
                 goto out;
             }
-            flags |= O_NOATIME;
         }
         err = v9fs_co_open(pdu, fidp, flags);
         if (err < 0) {