diff options
author | Kotresh HR <khiremat@redhat.com> | 2018-06-07 04:11:25 -0400 |
---|---|---|
committer | Kotresh HR <khiremat@redhat.com> | 2018-08-16 00:20:47 -0400 |
commit | 050969fb3cfb176fa206d3ae8169d6021879d9db (patch) | |
tree | 96b6b37b145611e9b788440ba2c0364615c0a05f /geo-replication/syncdaemon/resource.py | |
parent | 03aed04ac00e7985c7891a532d7c59a0a4c547ed (diff) | |
download | glusterfs-050969fb3cfb176fa206d3ae8169d6021879d9db.tar.gz glusterfs-050969fb3cfb176fa206d3ae8169d6021879d9db.tar.xz glusterfs-050969fb3cfb176fa206d3ae8169d6021879d9db.zip |
geo-rep: Fix geo-rep for older versions of unshare
Geo-rep mounts are private to worker. It uses
mount namespace using unshare command to achieve
the same. Well, the unshare command has to support
'--propagation' option. So geo-rep breaks on the
systems with older unshare version. The patch
makes it fall back to lazy umount behaviour if
the unshare does not support propagation option.
Backport of:
> BUG: 1589782
> Change-Id: Ia614f068aede288d63ac62fea4461b1865066054
> Signed-off-by: Kotresh HR <khiremat@redhat.com>
fixes: bz#1611111
Change-Id: Ia614f068aede288d63ac62fea4461b1865066054
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index a75d0ddfcc..e261812f39 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -40,6 +40,7 @@ from syncdutils import GX_GFID_CANONICAL_LEN from gsyncdstatus import GeorepStatus from syncdutils import lf, Popen, sup, Volinfo from syncdutils import Xattr, matching_disk_gfid, get_gfid_from_mnt +from syncdutils import unshare_propagation_supported ENOTSUP = getattr(errno, 'ENOTSUP', 'EOPNOTSUPP') @@ -900,15 +901,25 @@ class Mounter(object): assert(mntdata[-1] == '\0') mntpt = mntdata[:-1] assert(mntpt) - if mounted and rconf.args.subcmd == "slave" \ + + umount_master = False + umount_slave = False + if rconf.args.subcmd == "worker" \ + and not unshare_propagation_supported() \ + and not gconf.get("access-mount"): + umount_master = True + if rconf.args.subcmd == "slave" \ and not gconf.get("slave-access-mount"): + umount_slave = True + + if mounted and (umount_master or umount_slave): po = self.umount_l(mntpt) po.terminate_geterr(fail_on_err=False) if po.returncode != 0: po.errlog() rv = po.returncode - if rconf.args.subcmd == "slave" \ - and not gconf.get("slave-access-mount"): + logging.debug("Lazy umount done: %s" % mntpt) + if umount_master or umount_slave: self.cleanup_mntpt(mntpt) except: logging.exception('mount cleanup failure:') |