mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
f7da1caf8d
If there was a nested mountpoint inside an existing mount path, blkdeactivate could fail to unmount such a mountpoint as it needs to deactivate the deepest path first and continue upwards. For example the simplest reproducer: [root@rhel6-a ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 4G 0 disk |-vg-lvol0 (dm-2) 253:2 0 32M 0 lvm /mnt/a `-vg-lvol1 (dm-3) 253:3 0 32M 0 lvm /mnt/a/b Before this patch: [root@rhel6-a ~]# blkdeactivate -u Deactivating block devices: UMOUNT: unmounting vg-lvol0 (dm-2) mounted on /mnt/a umount: /mnt/a: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1)) UMOUNT: unmounting vg-lvol1 (dm-3) mounted on /mnt/a/b LVM: deactivating Logical Volume vg/lvol1 (deactivation of vg/lvol0 is skipped as /mnt/a that is on lvol0 can't be unmounted - it still has /mnt/a/b as nested mountpoint!) With this patch applied: [root@rhel6-a ~]# blkdeactivate -u Deactivating block devices: UMOUNT: unmounting vg-lvol1 (dm-3) mounted on /mnt/a/b UMOUNT: unmounting vg-lvol0 (dm-2) mounted on /mnt/a LVM: deactivating Logical Volume vg/lvol0 LVM: deactivating Logical Volume vg/lvol1 === Also, this patch contains a fix for processing mangled mount paths: [root@rhel6-a ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 4G 0 disk `-vg-lvol0 (dm-2) 253:2 0 32M 0 lvm /mnt/x y z [root@rhel6-a ~]# lsblk -r vg-lvol0 253:2 0 32M 0 lvm /mnt/x\x20y\x20z (the mount path is mangled with \xNN that is visible in raw lsblk output only and which is used in blkdeactive as well) Before this patch: [root@rhel6-a ~]# blkdeactivate -u Deactivating block devices: umount: /mnt/x\x20y\x20z: not found After this patch applied: [root@rhel6-a ~]# blkdeactivate -u Deactivating block devices: UMOUNT: unmounting vg-lvol0 (dm-2) mounted on /mnt/x\x20y\x20z LVM: deactivating Logical Volume vg/lvol0 |
||
---|---|---|
.. | ||
lvm2create_initrd | ||
.gitignore | ||
blk_availability_init_red_hat.in | ||
blk_availability_systemd_red_hat.service.in | ||
blkdeactivate.sh.in | ||
clvmd_fix_conf.sh | ||
clvmd_init_red_hat.in | ||
cmirrord_init_red_hat.in | ||
dm_event_systemd_red_hat.service.in | ||
dm_event_systemd_red_hat.socket.in | ||
fsadm.sh | ||
gdbinit | ||
lvm2_activation_generator_systemd_red_hat.c | ||
lvm2_lvmetad_init_red_hat.in | ||
lvm2_lvmetad_systemd_red_hat.service.in | ||
lvm2_lvmetad_systemd_red_hat.socket.in | ||
lvm2_monitoring_init_red_hat.in | ||
lvm2_monitoring_init_rhel4 | ||
lvm2_monitoring_systemd_red_hat.service.in | ||
lvm2_tmpfiles_red_hat.conf.in | ||
lvmconf_lockingtype2.sh | ||
lvmconf.sh | ||
lvmdump.sh | ||
Makefile.in | ||
relpath.awk | ||
vg_convert | ||
vgimportclone.sh | ||
VolumeGroup.ocf |