dcavalca / rpms / qemu

Forked from rpms/qemu 11 months ago
Clone

Blame qemu-virtio-9p-noatime.patch

Daniel P. Berrange 84237c
commit eed968607d656a218712df47a5e0432c21fd6994
Daniel P. Berrange 84237c
Author: Daniel P. Berrange <berrange@redhat.com>
Daniel P. Berrange 84237c
Date:   Mon Jan 16 18:11:40 2012 +0000
Daniel P. Berrange 84237c
Daniel P. Berrange 84237c
    hw/9pfs: Remove O_NOATIME flag from 9pfs open() calls in readonly mode
Daniel P. Berrange 84237c
    
Daniel P. Berrange 84237c
    When 2c74c2cb4bedddbfa67628fbd5f9273b4e0e9903 added support for
Daniel P. Berrange 84237c
    the 'readonly' flag against 9p filesystems, it also made QEMU
Daniel P. Berrange 84237c
    add the O_NOATIME flag as a side-effect.
Daniel P. Berrange 84237c
    
Daniel P. Berrange 84237c
    The O_NOATIME flag, however, may only be set by the file owner,
Daniel P. Berrange 84237c
    or a user with CAP_FOWNER capability.  QEMU cannot assume that
Daniel P. Berrange 84237c
    this is the case for filesytems exported to QEMU.
Daniel P. Berrange 84237c
    
Daniel P. Berrange 84237c
    eg, run QEMU as non-root, and attempt to pass the host OS
Daniel P. Berrange 84237c
    filesystem through to the guest OS with readonly enable.
Daniel P. Berrange 84237c
    The result is that the guest OS cannot open any files at
Daniel P. Berrange 84237c
    all.
Daniel P. Berrange 84237c
    
Daniel P. Berrange 84237c
    If O_NOATIME is really required, it should be optionally
Daniel P. Berrange 84237c
    enabled via a separate QEMU command line flag.
Daniel P. Berrange 84237c
    
Daniel P. Berrange 84237c
     * hw/9pfs/virtio-9p.c: Remove O_NOATIME
Daniel P. Berrange 84237c
    
Daniel P. Berrange 84237c
    Acked-by: M. Mohan Kumar <mohan@in.ibm.com>
Daniel P. Berrange 84237c
    Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Daniel P. Berrange 84237c
    Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Daniel P. Berrange 84237c
Daniel P. Berrange 84237c
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
Daniel P. Berrange 84237c
index dfe2025..a72ffc3 100644
Daniel P. Berrange 84237c
--- a/hw/9pfs/virtio-9p.c
Daniel P. Berrange 84237c
+++ b/hw/9pfs/virtio-9p.c
Daniel P. Berrange 84237c
@@ -1391,7 +1391,6 @@ static void v9fs_open(void *opaque)
Daniel P. Berrange 84237c
                 err = -EROFS;
Daniel P. Berrange 84237c
                 goto out;
Daniel P. Berrange 84237c
             }
Daniel P. Berrange 84237c
-            flags |= O_NOATIME;
Daniel P. Berrange 84237c
         }
Daniel P. Berrange 84237c
         err = v9fs_co_open(pdu, fidp, flags);
Daniel P. Berrange 84237c
         if (err < 0) {