Skip to content

Commit

Permalink
overlay: always use prjquota for XFS rootfs
Browse files Browse the repository at this point in the history
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
coreos#805, to
`mountOptions: []`).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1940704
  • Loading branch information
jlebon committed Mar 19, 2021
1 parent cba03b4 commit a6ec043
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tests/kola/root-reprovision/luks/test.sh
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tests/kola/root-reprovision/raid1/test.sh
Expand Up @@ -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
Expand Down

0 comments on commit a6ec043

Please sign in to comment.