From f25c88375b0fc03a97a423b565217fb9b55f7850 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Wed, 4 Jun 2014 17:41:10 +0530 Subject: geo-rep: entry_ops errors handling Xattr.lsetxattr_l call will not raise OSError which errno_wrap can handle, so we need to use Xattr.lsetxattr to get proper OSError and errno_wrap ignores or retries accordingly. Change-Id: Ie0a777152ddbaf9ed80c977e4704974fec997bea BUG: 1105083 Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/7972 Tested-by: Gluster Build System Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- geo-replication/syncdaemon/libcxattr.py | 5 ----- geo-replication/syncdaemon/resource.py | 7 ++++--- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'geo-replication') diff --git a/geo-replication/syncdaemon/libcxattr.py b/geo-replication/syncdaemon/libcxattr.py index e6035e26b43..74d120fa196 100644 --- a/geo-replication/syncdaemon/libcxattr.py +++ b/geo-replication/syncdaemon/libcxattr.py @@ -77,11 +77,6 @@ class Xattr(object): if ret == -1: cls.raise_oserr() - @classmethod - def lsetxattr_l(cls, path, attr, val): - """ lazy lsetxattr(): caller handles errno """ - cls.libc.lsetxattr(path, attr, val, len(val), 0) - @classmethod def lremovexattr(cls, path, attr): ret = cls.libc.lremovexattr(path, attr) diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index ca1dd4cf43b..eb6c87b102b 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -644,9 +644,10 @@ class Server(object): else: errno_wrap(os.rename, [entry, en], [ENOENT, EEXIST]) if blob: - errno_wrap(Xattr.lsetxattr_l, [pg, 'glusterfs.gfid.newfile', - blob], - [EEXIST], [ENOENT, ESTALE, EINVAL]) + errno_wrap(Xattr.lsetxattr, + [pg, 'glusterfs.gfid.newfile', blob], + [EEXIST], + [ENOENT, ESTALE, EINVAL]) @classmethod def meta_ops(cls, meta_entries): -- cgit