* [Qemu-devel] [PATCH] Remove O_NOATIME flag from 9pfs open() calls in readonly mode
@ 2012-01-16 18:11 Daniel P. Berrange
2012-01-23 18:32 ` Daniel P. Berrange
2012-01-24 8:21 ` M. Mohan Kumar
0 siblings, 2 replies; 3+ messages in thread
From: Daniel P. Berrange @ 2012-01-16 18:11 UTC (permalink / raw)
To: qemu-devel; +Cc: M. Mohan Kumar
From: "Daniel P. Berrange" <berrange@redhat.com>
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
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
hw/9pfs/virtio-9p.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index e6ba6ba..f8e2c07 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -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) {
--
1.7.7.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Remove O_NOATIME flag from 9pfs open() calls in readonly mode
2012-01-16 18:11 [Qemu-devel] [PATCH] Remove O_NOATIME flag from 9pfs open() calls in readonly mode Daniel P. Berrange
@ 2012-01-23 18:32 ` Daniel P. Berrange
2012-01-24 8:21 ` M. Mohan Kumar
1 sibling, 0 replies; 3+ messages in thread
From: Daniel P. Berrange @ 2012-01-23 18:32 UTC (permalink / raw)
To: qemu-devel, Aneesh Kumar K.V; +Cc: M. Mohan Kumar
Any thoughts on this fix ? Read-only mode is pretty useless without
it for non-root users.
Daniel
On Mon, Jan 16, 2012 at 06:11:40PM +0000, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> 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
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> hw/9pfs/virtio-9p.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
> index e6ba6ba..f8e2c07 100644
> --- a/hw/9pfs/virtio-9p.c
> +++ b/hw/9pfs/virtio-9p.c
> @@ -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) {
> --
> 1.7.7.5
>
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Remove O_NOATIME flag from 9pfs open() calls in readonly mode
2012-01-16 18:11 [Qemu-devel] [PATCH] Remove O_NOATIME flag from 9pfs open() calls in readonly mode Daniel P. Berrange
2012-01-23 18:32 ` Daniel P. Berrange
@ 2012-01-24 8:21 ` M. Mohan Kumar
1 sibling, 0 replies; 3+ messages in thread
From: M. Mohan Kumar @ 2012-01-24 8:21 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: qemu-devel, Aneesh Kumar K.V
Acked-by: M. Mohan Kumar <mohan@in.ibm.com>
On Monday, January 16, 2012 11:41:40 PM Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> 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
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> hw/9pfs/virtio-9p.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
> index e6ba6ba..f8e2c07 100644
> --- a/hw/9pfs/virtio-9p.c
> +++ b/hw/9pfs/virtio-9p.c
> @@ -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) {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-24 8:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16 18:11 [Qemu-devel] [PATCH] Remove O_NOATIME flag from 9pfs open() calls in readonly mode Daniel P. Berrange
2012-01-23 18:32 ` Daniel P. Berrange
2012-01-24 8:21 ` M. Mohan Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).