Skip to content

Commit

Permalink
anaconda: enable discard option for dom0 filesystems by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marmarek committed Mar 20, 2018
1 parent 38fdf4b commit c16a0c3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions anaconda/pyanaconda/kickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,10 @@ def execute(self, storage, ksdata, instClass):
self.mountpoint = ""
ty = None

if self.mountpoint.startswith('/') and not self.fsopts:
# enable discard for normal filesystems in dom0
self.fsopts = "defaults,discard"

# Sanity check mountpoint
if self.mountpoint != "" and self.mountpoint[0] != '/':
raise KickstartParseError(formatErrorMsg(self.lineno,
Expand Down Expand Up @@ -1245,6 +1249,10 @@ def execute(self, storage, ksdata, instClass):
else:
ty = storage.default_fstype

if self.mountpoint.startswith('/') and not self.fsopts:
# enable discard for normal filesystems in dom0
self.fsopts = "defaults,discard"

if not size and self.size:
try:
size = Size("%d MiB" % self.size)
Expand Down Expand Up @@ -1490,6 +1498,10 @@ def execute(self, storage, ksdata, instClass):
else:
ty = storage.default_fstype

if self.mountpoint.startswith('/') and not self.fsopts:
# enable discard for normal filesystems in dom0
self.fsopts = "defaults,discard"

# Sanity check mountpoint
if self.mountpoint != "" and self.mountpoint[0] != '/':
raise KickstartParseError(formatErrorMsg(self.lineno,
Expand Down

0 comments on commit c16a0c3

Please sign in to comment.