F #5228: fix race condition on fs resize (#952)

This commit is contained in:
Christian González authored and GitHub committed 2021-03-11 18:34:34 +01:00
1 parent 6ca3799647
commit a5001bfa1e
2 files changed
+9 -2

No files matched your search

@@ -47,8 +47,15 @@ module Storage
def self.setup_disk(device, mountpoint, bindpoint, options)
begin
# Get device filesystem (e.g ext4, xfs, ...)
retries = 3
device_fs = device_fs(device)
while retries > 0 && device_fs.empty?
sleep 0.2
retries -= 1
device_fs = device_fs(device)
end
# Resize device if extX like filesystem is used
if device_fs.match?(/^ext([2-4])$/)
resize_ext(device)
+2 -2
View File
@@ -34,7 +34,7 @@ container.clean(true)
rc = container.create
if !rc
STDERR.puts 'There was an error creating the containter. Check oned.log.'
STDERR.puts 'There was an error creating the containter.'
exit(-1)
end
@@ -43,7 +43,7 @@ end
rc = container.start
if !rc
STDERR.puts 'There was an error starting the containter. Check oned.log.'
STDERR.puts 'There was an error starting the containter.'
exit(-1)
end