From 3fe0c3c50eba9b64ebdd2abf0e8491d87078a440 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Thu, 30 Apr 2015 12:02:28 +0530 Subject: geo-rep: Fix minor bugs in meta-volume setup 1. Access unreferenced access of fd: In meta volume configuration for geo-rep, if geo-rep directory is not created yet, open fails with no fd, but it is accessed in close(fd). So after creating 'geo-rep' directory in meta-volume, open the lock file to get fd. 2. Fix volume_id in forming lock file name. For the very first time, gconf.volume_id would be null, as config is not reloaded yet. Hence, use 'uuid' function to get the volume id. Change-Id: I8381ab7a44bc800df25d596218466641c10937a4 BUG: 1210344 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/10458 Tested-by: Gluster Build System Reviewed-by: Aravinda VK Tested-by: NetBSD Build System --- geo-replication/syncdaemon/master.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py index 03d5b572cef..38535884ec6 100644 --- a/geo-replication/syncdaemon/master.py +++ b/geo-replication/syncdaemon/master.py @@ -460,7 +460,7 @@ class GMasterCommon(object): def mgmt_lock(self): """Take management volume lock """ - bname = str(gconf.volume_id) + "_subvol_" + str(gconf.subvol_num) \ + bname = str(self.uuid) + "_subvol_" + str(gconf.subvol_num) \ + ".lock" mgmt_lock_dir = os.path.join(gconf.meta_volume_mnt, "geo-rep") path = os.path.join(mgmt_lock_dir, bname) @@ -473,6 +473,7 @@ class GMasterCommon(object): logging.info("Creating geo-rep directory in meta volume...") try: os.makedirs(mgmt_lock_dir) + fd = os.open(path, os.O_CREAT | os.O_RDWR) except OSError: ex = sys.exc_info()[1] if ex.errno == EEXIST: -- cgit