From 3e968ba2de3ff0c883dab4b52cbe6bfc8ee89b44 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 8 Apr 2019 12:49:55 +0200 Subject: [PATCH] B # 3190 Fix LXD unmap symlink issues Co-authored-by: Daniel Clavijo Coca (cherry picked from commit 986b8caa233d64b88b58f3e1a67d68126e9ba763) --- src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb b/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb index 6d9cb78ade..66efcac38a 100644 --- a/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb +++ b/src/vmm_mad/remotes/lib/lxd/mapper/mapper.rb @@ -161,7 +161,11 @@ class Mapper device = '' real_path = directory - real_path = File.realpath(directory) if File.symlink?(one_vm.sysds_path) + + is_rootfs = real_path =~ %r{.*/rootfs} + is_shared_ds = File.symlink?(one_vm.sysds_path) + + real_path = File.realpath(directory) if !is_rootfs && is_shared_ds sys_parts.each {|d| if d['mountpoint'] == real_path