482eca3099
This patch does three things. Following are the descriptions. === Create a separate function for delete transactions so that parent function is little smaller. Also close transaction if an error happens. === When docker is being shutdown, save deviceset metadata first before trying to remove the devices. Generally caller gives only 10 seconds for shutdown to complete and then kills it after that. So if some device is busy, we will wait 20 seconds for it removal and never be able to save metadata. So first save metadata and then deal with device removal. === Move issue discard operation in a separate function. This makes reading code little easier. Also don't issue discards if device is still open. That means devices is still probably being used and issuing discards is not a good idea. This is especially true in case of deferred deletion. We want to issue discards when device is not open. At that time device can be deleted too. Otherwise we will issue discards and deletion will actually fail. Later we will try deletion again and issue discards again and deletion will fail again as device is open and busy. So this will ensure that discards are issued once when device is not open and it can actually be deleted. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> |
||
---|---|---|
.. | ||
aufs | ||
btrfs | ||
devmapper | ||
graphtest | ||
overlay | ||
vfs | ||
windows | ||
zfs | ||
driver.go | ||
driver_freebsd.go | ||
driver_linux.go | ||
driver_unsupported.go | ||
driver_windows.go | ||
fsdiff.go | ||
imagerestorer.go |