qemu-patch-raspberry4/hw/9pfs
Omar Sandoval a5804fcf7b 9pfs: local: ignore O_NOATIME if we don't have permissions
QEMU's local 9pfs server passes through O_NOATIME from the client. If
the QEMU process doesn't have permissions to use O_NOATIME (namely, it
does not own the file nor have the CAP_FOWNER capability), the open will
fail. This causes issues when from the client's point of view, it
believes it has permissions to use O_NOATIME (e.g., a process running as
root in the virtual machine). Additionally, overlayfs on Linux opens
files on the lower layer using O_NOATIME, so in this case a 9pfs mount
can't be used as a lower layer for overlayfs (cf.
dabfe19719/vmtest/onoatimehack.c
and https://github.com/NixOS/nixpkgs/issues/54509).

Luckily, O_NOATIME is effectively a hint, and is often ignored by, e.g.,
network filesystems. open(2) notes that O_NOATIME "may not be effective
on all filesystems. One example is NFS, where the server maintains the
access time." This means that we can honor it when possible but fall
back to ignoring it.

Acked-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Message-Id: <e9bee604e8df528584693a4ec474ded6295ce8ad.1587149256.git.osandov@fb.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
2020-05-14 08:06:43 +02:00
..
9p-local.c 9p: local: always return -1 on error in local_unlinkat_common 2020-01-20 15:11:39 +01:00
9p-local.h 9pfs: local: open/opendir: don't follow symlinks 2017-02-28 11:21:15 +01:00
9p-posix-acl.c 9pfs: local: lremovexattr: don't follow symlinks 2017-02-28 11:21:15 +01:00
9p-proxy.c 9p/proxy: Fix export_flags 2020-03-10 16:12:49 +01:00
9p-proxy.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
9p-synth.c hw/9pfs/9p-synth: added directory for readdir test 2020-02-08 09:29:04 +01:00
9p-synth.h hw/9pfs/9p-synth: added directory for readdir test 2020-02-08 09:29:04 +01:00
9p-util.c 9p: Move a couple xattr functions to 9p-util 2018-06-07 12:17:22 +02:00
9p-util.h 9pfs: local: ignore O_NOATIME if we don't have permissions 2020-05-14 08:06:43 +02:00
9p-xattr-user.c 9pfs: local: lremovexattr: don't follow symlinks 2017-02-28 11:21:15 +01:00
9p-xattr.c 9p: Move a couple xattr functions to 9p-util 2018-06-07 12:17:22 +02:00
9p-xattr.h 9pfs: fix XattrOperations typedef 2018-01-08 11:18:22 +01:00
9p.c 9pfs: validate count sent by client with T_readdir 2020-02-08 09:28:54 +01:00
9p.h 9pfs: require msize >= 4096 2020-02-08 09:28:43 +01:00
codir.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
cofile.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
cofs.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
coth.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
coth.h Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
coxattr.c Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
Kconfig 9p: simplify source file selection 2019-08-20 17:26:19 +02:00
Makefile.objs 9pfs: remove unnecessary conditionals 2019-03-07 21:45:53 +01:00
trace-events 9p: unsigned type for type, version, path 2019-10-10 11:36:04 +02:00
virtio-9p-device.c * Register qdev properties as class properties (Marc-André) 2020-01-27 09:44:04 +00:00
virtio-9p.h 9pfs: introduce transport specific callbacks 2017-01-03 17:28:44 +01:00
xen-9p-backend.c 9p: init_in_iov_from_pdu can truncate the size 2020-01-20 15:11:39 +01:00
xen-9pfs.h xen: Import other xen/io/*.h 2019-06-24 10:42:30 +01:00