Skip to content

Commit

Permalink
enable discard option for dom0 filesystems by default
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Dec 25, 2019
1 parent 71d5e49 commit 6b81491
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions 0028-enable-discard-option-for-dom0-filesystems-by-defaul.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 633dc89cae0ebd597cc9069fdced3c8485ba5e46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
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

1 change: 1 addition & 0 deletions anaconda.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 6b81491

Please sign in to comment.