Browse Source

uvol: call umount instead of using 'block umount'

Calling 'block umount' results in *all* devices listed in
/etc/config/fstab being unmounted.
Just call 'umount /dev/$devname' directly instead as that has the
desired effect.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
lilik-openwrt-22.03
Daniel Golle 3 years ago
parent
commit
e17a931c49
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      utils/uvol/files/lvm.sh
  2. +2
    -2
      utils/uvol/files/ubi.sh

+ 1
- 1
utils/uvol/files/lvm.sh View File

@ -202,7 +202,7 @@ disactivatevol() {
*)
[ "$lv_active" = "active" ] || return 0
devname="$(getdev "$1")"
[ "$devname" ] && /sbin/block umount "$devname"
[ "$devname" ] && umount "/dev/$devname"
lvm_cmd lvchange -a n "$lv_full_name"
lvm_cmd lvchange -k y "$lv_full_name" || return $?
return 0


+ 2
- 2
utils/uvol/files/ubi.sh View File

@ -168,12 +168,12 @@ disactivatevol() {
vol_is_mode "$voldev" wo && return 22
vol_is_mode "$voldev" wp && return 16
if vol_is_mode "$voldev" ro; then
/sbin/block umount "ubiblock${voldev:3}"
grep -q "^/dev/ubiblock${voldev:3}" /proc/self/mounts && umount "/dev/ubiblock${voldev:3}"
ubiblock --remove "/dev/$voldev"
ubirename "/dev/$ubidev" "uvol-ro-$1" "uvol-rd-$1" || return $?
return 0
elif vol_is_mode "$voldev" rw; then
/sbin/block umount "$voldev"
umount "/dev/$voldev"
ubirename "/dev/$ubidev" "uvol-rw-$1" "uvol-wd-$1" || return $?
block_hotplug remove "$voldev"
return 0


Loading…
Cancel
Save