qemu: remove 9p O_NOATIME patch

This is redundant with QEMU commit a5804fcf7b ("9pfs: local: ignore
O_NOATIME if we don't have permissions"), included in QEMU since
5.1.0, which will retry opens without O_NOATIME if they fail with it.
main
Alyssa Ross 2 years ago
parent 1a268c42c8
commit 2b2ac31248
  1. 49
      pkgs/applications/virtualization/qemu/9p-ignore-noatime.patch
  2. 2
      pkgs/applications/virtualization/qemu/default.nix

@ -1,49 +0,0 @@
From 9e4932ae99946b1a08ab5b5345fd2bc3486e54a5 Mon Sep 17 00:00:00 2001
From: aszlig <aszlig@nix.build>
Date: Mon, 18 Mar 2019 13:21:01 +0100
Subject: [PATCH] 9pfs: Ignore O_NOATIME open flag
Since Linux 4.19, overlayfs uses the O_NOATIME flag on its lowerdir,
which in turn causes errors when the Nix store is mounted in the guest
because the file owner of the store paths typically don't match the
owner of the QEMU process.
After submitting a patch to the overlayfs mailing list[1], it turns out
that my patch was incomplete[2] and needs a bit more rework.
So instead of using an incomplete kernel patch in nixpkgs, which affects
*all* users of overlayfs, not just NixOS VM tests, I decided that for
now it's better to patch QEMU instead.
The change here really only ignores the O_NOATIME flag so that the
behaviour is similar to what NFS does. From open(2):
This flag may not be effective on all filesystems. One example is NFS,
where the server maintains the access time.
This change is therefore only temporary until the final fix lands in the
stable kernel releases.
[1]: https://www.spinics.net/lists/linux-unionfs/msg06755.html
[2]: https://www.spinics.net/lists/linux-unionfs/msg06756.html
Signed-off-by: aszlig <aszlig@nix.build>
---
hw/9pfs/9p.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index a6d6b3f835..4eb26e2294 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -139,7 +139,6 @@ static int dotl_to_open_flags(int flags)
{ P9_DOTL_DSYNC, O_DSYNC },
{ P9_DOTL_FASYNC, FASYNC },
#ifndef CONFIG_DARWIN
- { P9_DOTL_NOATIME, O_NOATIME },
/*
* On Darwin, we could map to F_NOCACHE, which is
* similar, but doesn't quite have the same
--
2.35.1

@ -142,8 +142,6 @@ stdenv.mkDerivation rec {
# set was removed during the process of upstreaming this functionality, and
# will still be needed in nix until the macOS SDK reaches 10.13+.
./provide-fallback-for-utimensat.patch
# Still needed indefinitely
./9p-ignore-noatime.patch
]
++ lib.optional nixosTestRunner ./force-uid0-on-9p.patch;

Loading…
Cancel
Save