dev-next - fsadm: fix condition when using --getsize64
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=63c58d2a5d935cd78c77f3db13a655e68fb36367 Commit: 63c58d2a5d935cd78c77f3db13a655e68fb36367 Parent: 9684e82cc44cfec66f30b807160c19c06df2a2d8 Author: Zdenek Kabelac <[email protected]> AuthorDate: Wed Mar 24 16:11:55 2021 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Mar 24 16:34:34 2021 +0100
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 at alumni.princeton.edu
--- scripts/fsadm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/fsadm.sh +1 -1
@@ -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)