diff --git a/SOURCES/lvm2-2_02_188-fsadm-better-check-for-getsize64-support.patch b/SOURCES/lvm2-2_02_188-fsadm-better-check-for-getsize64-support.patch new file mode 100644 index 0000000..98b1201 --- /dev/null +++ b/SOURCES/lvm2-2_02_188-fsadm-better-check-for-getsize64-support.patch @@ -0,0 +1,26 @@ + scripts/fsadm.sh | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh +index c59d7b6..24b0e36 100755 +--- a/scripts/fsadm.sh ++++ b/scripts/fsadm.sh +@@ -377,14 +377,11 @@ detect_mounted() { + # get the full size of device in bytes + detect_device_size() { + # check if blockdev supports getsize64 +- "$BLOCKDEV" --help 2>&1 | "$GREP" getsize64 >"$NULL" +- if test $? -eq 0; then +- DEVSIZE=$("$BLOCKDEV" --getsize64 "$VOLUME") ++ DEVSIZE=$("$BLOCKDEV" --getsize64 "$VOLUME" 2>"$NULL" || true) ++ if test -n "$DEVSIZE" ; then ++ DEVSIZE=$("$BLOCKDEV" --getsize "$VOLUME" || true) + test -n "$DEVSIZE" || error "Cannot read size of device \"$VOLUME\"." +- else +- DEVSIZE=$("$BLOCKDEV" --getsize "$VOLUME") +- test -n "$DEVSIZE" || error "Cannot read size of device \"$VOLUME\"." +- SSSIZE=$("$BLOCKDEV" --getss "$VOLUME") ++ SSSIZE=$("$BLOCKDEV" --getss "$VOLUME" || true) + test -n "$SSSIZE" || error "Cannot read sector size of device \"$VOLUME\"." + DEVSIZE=$(("$DEVSIZE" * "$SSSIZE")) + fi diff --git a/SOURCES/lvm2-2_02_188-fsadm-fix-bash-artihmetic.patch b/SOURCES/lvm2-2_02_188-fsadm-fix-bash-artihmetic.patch new file mode 100644 index 0000000..bea6aaa --- /dev/null +++ b/SOURCES/lvm2-2_02_188-fsadm-fix-bash-artihmetic.patch @@ -0,0 +1,16 @@ + scripts/fsadm.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh +index 24b0e36..d69cee3 100755 +--- a/scripts/fsadm.sh ++++ b/scripts/fsadm.sh +@@ -383,7 +383,7 @@ detect_device_size() { + test -n "$DEVSIZE" || error "Cannot read size of device \"$VOLUME\"." + SSSIZE=$("$BLOCKDEV" --getss "$VOLUME" || true) + test -n "$SSSIZE" || error "Cannot read sector size of device \"$VOLUME\"." +- DEVSIZE=$(("$DEVSIZE" * "$SSSIZE")) ++ DEVSIZE=$(( $DEVSIZE * $SSSIZE )) + fi + } + diff --git a/SOURCES/lvm2-2_02_188-fsadm-fix-unbound-variable-usage.patch b/SOURCES/lvm2-2_02_188-fsadm-fix-unbound-variable-usage.patch new file mode 100644 index 0000000..251d652 --- /dev/null +++ b/SOURCES/lvm2-2_02_188-fsadm-fix-unbound-variable-usage.patch @@ -0,0 +1,29 @@ + scripts/fsadm.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh +index d69cee3..561c180 100755 +--- a/scripts/fsadm.sh ++++ b/scripts/fsadm.sh +@@ -798,6 +798,7 @@ fi + + CHECK="" + RESIZE="" ++NEWSIZE="" + + while [ "$#" -ne 0 ] + do +@@ -811,8 +812,11 @@ do + "-y"|"--yes") YES="-y" ;; + "-l"|"--lvresize") DO_LVRESIZE=1 ;; + "-c"|"--cryptresize") DO_CRYPTRESIZE=1 ;; +- "check") CHECK=$2 ; shift ;; +- "resize") RESIZE=$2 ; NEWSIZE=$3 ; shift 2 ;; ++ "check") test -z "${2-}" && error "Missing . (see: $TOOL --help)" ++ CHECK=$2 ; shift ;; ++ "resize") test -z "${2-}" && error "Missing . (see: $TOOL --help)" ++ RESIZE=$2 ; shift ++ if test -n "${2-}" ; then NEWSIZE="${2-}" ; shift ; fi ;; + *) error "Wrong argument \"$1\". (see: $TOOL --help)" + esac + shift diff --git a/SPECS/lvm2.spec b/SPECS/lvm2.spec index 3ffcfa3..cd6cc62 100644 --- a/SPECS/lvm2.spec +++ b/SPECS/lvm2.spec @@ -33,7 +33,7 @@ %global boom_dir boom-%{boom_version} #%%global scratch .bz1628529_4 -%global scratch .3 +%global scratch .4 %if 0%{?rhel} %ifnarch i686 x86_64 ppc64le s390x @@ -103,6 +103,10 @@ Patch16: lvm2-2_02_188-filters-persistent-filter-hides-rename-failure.patch # BZ 1663473: Patch17: lvm2-2_02_188-fsadm-handle-fsck-return-1-for-corrected-fs.patch Patch18: lvm2-2_02_188-fsadm-enhance-error-handling.patch +# BZ 1905072: +Patch19: lvm2-2_02_188-fsadm-better-check-for-getsize64-support.patch +Patch20: lvm2-2_02_188-fsadm-fix-bash-artihmetic.patch +Patch21: lvm2-2_02_188-fsadm-fix-unbound-variable-usage.patch # BZ 1777364: Patch50: boom-etc-Remove-executable-permission-from-etc-default-bo.patch Patch51: boom-man-Fix-line-starting-with.patch @@ -179,6 +183,9 @@ or more physical volumes and creating one or more logical volumes %patch16 -p1 -b .persistent_filter_hides_rename_failure %patch17 -p1 -b .fsadm_handle_fsck_return_1_for_corrected_fs %patch18 -p1 -b .fsadm_enhance_error_handling +%patch19 -p1 -b .fsadm_better_check_for_getsize64_support +%patch20 -p1 -b .fsadm_fix_bash_artihmetic +%patch21 -p1 -b .fsadm_fix_unbound_variable_usage %build %global _default_pid_dir /run @@ -980,6 +987,9 @@ This package provides the python2 version of boom. %endif %changelog +* Mon Feb 08 2021 Marian Csontos - 7:2.02.187-6.el7_9.4 +- Fix fsadm behavior with missing parameters. + * Thu Nov 26 2020 Marian Csontos - 7:2.02.187-6.el7_9.3 - Fix lvresize handling of fsck exit code 1 - FS errors corrected.