Skip to content

Commit

Permalink
Create cached LVs before non-cached LVs
Browse files Browse the repository at this point in the history
In order to minimize the risk of non-cached LVs taking space on fast PVs that
should be used by caches.
  • Loading branch information
vpodzime committed Jul 31, 2015
1 parent c8645fe commit f0d9bf8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion blivet/deviceaction.py
Expand Up @@ -26,7 +26,7 @@
from . import udev
from .util import get_current_entropy
from .devices import StorageDevice
from .devices import PartitionDevice
from .devices import PartitionDevice, LVMLogicalVolumeDevice
from .formats import getFormat, luks
from parted import partitionFlag, PARTITION_LBA
from .i18n import _, N_
Expand Down Expand Up @@ -334,6 +334,14 @@ def requires(self, action):
otherNum = action.device.partedPartition.number
if selfNum > otherNum:
rc = True
elif (action.isCreate and action.isDevice and
isinstance(self.device, LVMLogicalVolumeDevice) and
isinstance(action.device, LVMLogicalVolumeDevice) and
self.device.vg == action.device.vg):
# create cached LVs before non-cached LVs so that fast cache space
# is not taken by non-cached LVs
if not self.device.cached and action.device.cached:
rc = True
elif (action.isAdd and action.container == self.container):
rc = True

Expand Down

0 comments on commit f0d9bf8

Please sign in to comment.