From 2cf70079c28501fe7fcfe72c55d5efadb5cd4e3d Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Wed, 25 May 2016 11:56:56 +0530 Subject: geo-rep: Handle stime/xtime set failures While setting stime/xtime, if the file or directory is already deleted then Geo-rep will crash with ENOENT. With this patch, Geo-rep will ignores ENOENT since stime/xtime can't be applied on a deleted file/directory. Change-Id: I2d90569e51565f81ae53fcb23323e4f47c9e9672 Signed-off-by: Aravinda VK BUG: 1345882 Reviewed-on: http://review.gluster.org/14529 (cherry picked from commit 1a348bfaeb9f2a50ec8ce27e5477e9b430c58b3c) Reviewed-on: http://review.gluster.org/14713 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Kotresh HR --- geo-replication/syncdaemon/resource.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'geo-replication') diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 27f7e84a2ce..bc7b13c95bc 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -534,17 +534,21 @@ class Server(object): @_pathguard def set_stime(cls, path, uuid, mark): """set @mark as stime for @uuid on @path""" - Xattr.lsetxattr( - path, '.'.join([cls.GX_NSPACE, uuid, 'stime']), - struct.pack('!II', *mark)) + errno_wrap(Xattr.lsetxattr, + [path, + '.'.join([cls.GX_NSPACE, uuid, 'stime']), + struct.pack('!II', *mark)], + [ENOENT]) @classmethod @_pathguard def set_xtime(cls, path, uuid, mark): """set @mark as xtime for @uuid on @path""" - Xattr.lsetxattr( - path, '.'.join([cls.GX_NSPACE, uuid, 'xtime']), - struct.pack('!II', *mark)) + errno_wrap(Xattr.lsetxattr, + [path, + '.'.join([cls.GX_NSPACE, uuid, 'xtime']), + struct.pack('!II', *mark)], + [ENOENT]) @classmethod @_pathguard -- cgit