1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Description: Fix size detection for non-block devices
Author: Bastian Blank <bastian.blank@credativ.de>
--- a/ganeti/os/noop/export
+++ b/ganeti/os/noop/export
@@ -28,7 +28,11 @@
# https://bugs.launchpad.net/ubuntu/+source/dash/+bug/249620
if test -n "$EXP_SIZE_FD"; then
- blockdev --getsize64 "$EXPORT_DEVICE" >&"$EXP_SIZE_FD"
+ if [ -f "$EXPORT_DEVICE" ]; then
+ stat -c '%s' "$EXPORT_DEVICE" >&"$EXP_SIZE_FD"
+ else
+ blockdev --getsize64 "$EXPORT_DEVICE" >&"$EXP_SIZE_FD"
+ fi
fi
dd if="$EXPORT_DEVICE" bs=1048576
|