summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2015-04-30 12:02:28 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-04 07:23:03 -0700
commit10d588fd849d92c3d7f4f86029b76098230c93b6 (patch)
treeeae5c91bfd71e46c735afbb46764d6fcd9a2a354
parent3ed770c90cbf796e3262f0ff4553dc39457c222e (diff)
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. BUG: 1217939 Change-Id: I06bf659ec506943c7ebf5303cc56a2e7748fbad0 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10458 Reviewed-on: http://review.gluster.org/10506 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Aravinda VK <avishwan@redhat.com>
-rw-r--r--geo-replication/syncdaemon/master.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 0de384b73b0..6318438608a 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -452,7 +452,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)
@@ -465,6 +465,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: