blockdev: add workaround for issue #3229
Enforce the 'writeback' cache setting for an EFI disk with RBD driver
to work around issue #3229. See also commit 6aaad230 ("fix #3329: turn
on cache=writeback for efidisks on rbd").
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
8ca64671a7
commit
f2f2edcd7f
1 changed files with 8 additions and 1 deletions
|
|
@ -128,7 +128,14 @@ sub generate_file_blockdev {
|
|||
$scfg = PVE::Storage::storage_config($storecfg, $storeid);
|
||||
}
|
||||
|
||||
$blockdev->{cache} = generate_blockdev_drive_cache($drive, $scfg);
|
||||
# SPI flash does lots of read-modify-write OPs, without writeback this gets really slow #3329
|
||||
# It also needs the rbd_cache_policy set to 'writeback' on the RBD side, which is done by the
|
||||
# storage layer.
|
||||
if ($blockdev->{driver} eq 'rbd' && $drive->{interface} eq 'efidisk') {
|
||||
$blockdev->{cache} = { direct => JSON::false, 'no-flush' => JSON::false };
|
||||
} else {
|
||||
$blockdev->{cache} = generate_blockdev_drive_cache($drive, $scfg);
|
||||
}
|
||||
|
||||
my $driver = $blockdev->{driver};
|
||||
# only certain drivers have the aio setting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue