1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

fsadm: fix condition when using --getsize64

When blocksize --getsize64 gives empty result we want to fallback
to ancient  --getsize * --getss  calculation (RHBZ #1942486).

Reported by: ajschorr@alumni.princeton.edu
This commit is contained in:
Zdenek Kabelac 2021-03-24 16:11:55 +01:00
parent 9684e82cc4
commit 63c58d2a5d

View File

@ -378,7 +378,7 @@ detect_mounted() {
detect_device_size() {
# check if blockdev supports getsize64
DEVSIZE=$("$BLOCKDEV" --getsize64 "$VOLUME" 2>"$NULL" || true)
if test -n "$DEVSIZE" ; then
if test -z "$DEVSIZE" ; then
DEVSIZE=$("$BLOCKDEV" --getsize "$VOLUME" || true)
test -n "$DEVSIZE" || error "Cannot read size of device \"$VOLUME\"."
SSSIZE=$("$BLOCKDEV" --getss "$VOLUME" || true)