diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-06-12 19:39:49 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-06-14 04:52:31 -0700 |
commit | 310e29808b1aaa0208ccd13e2ba802007861231e (patch) | |
tree | 8008d638680a6d35fdb958dcfd70abb97deca3a0 /xlators | |
parent | d191f745bbec5f53e19c33702e5749fa8fba9aee (diff) |
cluster/afr: Treat EEXIST as success in hardlink
BUG: 831151
Change-Id: I6ecc099cf5f3ae58b19dfb00ed0b3f9959e711e5
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3571
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index b039124d2..a23a74d72 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -1195,6 +1195,18 @@ afr_sh_entry_impunge_hardlink_cbk (call_frame_t *impunge_frame, void *cookie, struct iatt *postparent, dict_t *xdata) { int call_count = 0; + afr_local_t *impunge_local = NULL; + afr_self_heal_t *impunge_sh = NULL; + + impunge_local = impunge_frame->local; + impunge_sh = &impunge_local->self_heal; + + if (IA_IFLNK == impunge_sh->entrybuf.ia_type) { + //For symlinks impunge is attempted un-conditionally + //So the file can already exist. + if ((op_ret < 0) && (op_errno == EEXIST)) + op_ret = 0; + } call_count = afr_frame_return (impunge_frame); if (call_count == 0) |