diff --git a/0028-enable-discard-option-for-dom0-filesystems-by-defaul.patch b/0028-enable-discard-option-for-dom0-filesystems-by-defaul.patch new file mode 100644 index 0000000..24e0b86 --- /dev/null +++ b/0028-enable-discard-option-for-dom0-filesystems-by-defaul.patch @@ -0,0 +1,33 @@ +From 633dc89cae0ebd597cc9069fdced3c8485ba5e46 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= + +Date: Wed, 25 Dec 2019 09:36:06 +0100 +Subject: [PATCH] enable discard option for dom0 filesystems by default + +This may have performance impact on some older SSD, but on the other +hand, without this option it's pretty easy to fill the whole LVM thin +pool even if there is plenty free space in dom0. +Note that this doesn't enable it on LUKS layer, this is still disabled +by default. + +Fixes QubesOS/qubes-issues#3226 +--- + pyanaconda/storage/fsset.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/pyanaconda/storage/fsset.py b/pyanaconda/storage/fsset.py +index 8d2390ddb..6117c6d0a 100644 +--- a/pyanaconda/storage/fsset.py ++++ b/pyanaconda/storage/fsset.py +@@ -771,6 +771,8 @@ class FSSet(object): + break + if device.encrypted: + options += ",x-systemd.device-timeout=0" ++ if mountpoint.startswith('/'): ++ options += ",discard" + devspec = device.fstab_spec + dump = device.format.dump + if device.format.check and mountpoint == "/": +-- +2.21.0 + diff --git a/anaconda.spec.in b/anaconda.spec.in index 8b2d93e..abf4223 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -48,6 +48,7 @@ Patch23: 0024-Do-not-mount-pre-existing-partitions-and-do-not-dete.patch Patch24: 0025-Set-encrypted-partitioning-by-default.patch Patch25: 0026-Set-default-hostname-to-dom0.patch Patch26: 0027-Setup-grubx64.efi-directly-as-a-bootloader.patch +Patch27: 0028-enable-discard-option-for-dom0-filesystems-by-defaul.patch # Versions of required components (done so we make sure the buildrequires # match the requires versions of things).