uvol: lvm: make 'up' call reliable
authorDaniel Golle <redacted>
Fri, 30 Jul 2021 01:14:39 +0000 (02:14 +0100)
committerDaniel Golle <redacted>
Fri, 30 Jul 2021 01:16:55 +0000 (02:16 +0100)
Changing a volume right after activation doesn't work well due to some
caching or race-condition issue.
Perform activation as last lvchange operation as a work-around.

Signed-off-by: Daniel Golle <redacted>
utils/uvol/files/lvm.sh

index c06e2f1020b4511dbf91d7128a9c942efedce295..20ad0bcb5de777c6ffac20fd1e8d80dd2dc74e6c 100644 (file)
@@ -179,8 +179,8 @@ activatevol() {
                *)
                        [ "$lv_active" = "active" ] && return 0
                        uvol_uci_commit "$1"
-                       lvm_cmd lvchange -a y "$lv_full_name" || return $?
                        lvm_cmd lvchange -k n "$lv_full_name" || return $?
+                       lvm_cmd lvchange -a y "$lv_full_name" || return $?
                        return 0
                        ;;
        esac
git clone https://git.99rst.org/PROJECT