From 2b7ac2bfb3461073486a7b296a76ef26b0d5d733 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 22 May 2017 14:39:10 +0200 Subject: [PATCH] fsadm: always detect mounted fs with extX Since we add more validation to 'detect_mounted' function make sure we always use it even with 'resize' action, so numerous validations are not skipped. --- scripts/fsadm.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh index 534aac10d..831b3caa2 100755 --- a/scripts/fsadm.sh +++ b/scripts/fsadm.sh @@ -318,6 +318,9 @@ validate_parsing() { # - unmounted for downsize #################################### resize_ext() { + local IS_MOUNTED=0 + detect_mounted && IS_MOUNTED=1 + verbose "Parsing $TUNE_EXT -l \"$VOLUME\"" for i in $(LC_ALL=C "$TUNE_EXT" -l "$VOLUME"); do case "$i" in @@ -330,7 +333,7 @@ resize_ext() { FSFORCE=$FORCE if [ "$NEWBLOCKCOUNT" -lt "$BLOCKCOUNT" -o "$EXTOFF" -eq 1 ]; then - detect_mounted && verbose "$RESIZE_EXT needs unmounted filesystem" && try_umount + test $IS_MOUNTED -eq 1 && verbose "$RESIZE_EXT needs unmounted filesystem" && try_umount REMOUNT=$MOUNTED if test -n "$MOUNTED" ; then # Forced fsck -f for umounted extX filesystem.