From a6ec043dd34a42bed69e1d27f78460c4c42e3e37 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 19 Mar 2021 12:21:13 -0400 Subject: [PATCH] overlay: always use prjquota for XFS rootfs By default, we use `prjquota` for the rootfs for container orchestrators to monitor and set drive space limits. However, with the added support for rootfs reprovisioning, we made this conditional on the rootfs not being reprovisioned, with the assumption that you can just set whatever options you'd like instead. Though actually doing that is really awkward right now, and it requires surfacing prjquota in user documentations (see https://bugzilla.redhat.com/show_bug.cgi?id=1940704#c2). Since AFAICT `prjquota` doesn't actually have any significant overhead, let's just simplify the messaging to: we *always* enable prjquota on XFS root filesystems. Users who want to override this can fallback to `rpm-ostree kargs` (and eventually once we have https://github.com/coreos/fedora-coreos-config/issues/805, to `mountOptions: []`). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1940704 --- .../dracut/modules.d/40ignition-ostree/coreos-rootflags.sh | 7 ------- tests/kola/root-reprovision/luks/test.sh | 6 ++++++ tests/kola/root-reprovision/raid1/test.sh | 6 ++++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-rootflags.sh b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-rootflags.sh index 332665e4f3..8c25d96118 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-rootflags.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/coreos-rootflags.sh @@ -3,14 +3,7 @@ set -euo pipefail rootpath=/dev/disk/by-label/root -# If the rootfs was reprovisioned, then the user is free to define their own -# rootflags. -if [ -d /run/ignition-ostree-transposefs/root ]; then - exit 0 -fi - eval $(blkid -o export ${rootpath}) -# this really should always be true, but let's be conservative if [ "${TYPE}" == "xfs" ]; then # We use prjquota on XFS by default to aid multi-tenant Kubernetes (and # other container) clusters. See diff --git a/tests/kola/root-reprovision/luks/test.sh b/tests/kola/root-reprovision/luks/test.sh index 4a2307866a..656b6feee6 100755 --- a/tests/kola/root-reprovision/luks/test.sh +++ b/tests/kola/root-reprovision/luks/test.sh @@ -21,6 +21,12 @@ fstype=$(findmnt -nvr / -o FSTYPE) [[ ${fstype} == xfs ]] ok "source is XFS on LUKS device" +rootflags=$(findmnt /sysroot -no OPTIONS) +if ! grep prjquota <<< "${rootflags}"; then + fatal "missing prjquota in root mount flags: ${rootflags}" +fi +ok "root mounted with prjquota" + case "${AUTOPKGTEST_REBOOT_MARK:-}" in "") # check that ignition-ostree-growfs ran diff --git a/tests/kola/root-reprovision/raid1/test.sh b/tests/kola/root-reprovision/raid1/test.sh index f18673e1f9..a1e510cffa 100755 --- a/tests/kola/root-reprovision/raid1/test.sh +++ b/tests/kola/root-reprovision/raid1/test.sh @@ -21,6 +21,12 @@ fstype=$(findmnt -nvr / -o FSTYPE) [[ ${fstype} == xfs ]] ok "source is XFS on RAID1 device" +rootflags=$(findmnt /sysroot -no OPTIONS) +if ! grep prjquota <<< "${rootflags}"; then + fatal "missing prjquota in root mount flags: ${rootflags}" +fi +ok "root mounted with prjquota" + case "${AUTOPKGTEST_REBOOT_MARK:-}" in "") # check that ignition-ostree-growfs didn't run