summaryrefslogtreecommitdiffstats
path: root/xlators/encryption
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/encryption')
-rw-r--r--xlators/encryption/crypt/src/crypt.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/xlators/encryption/crypt/src/crypt.c b/xlators/encryption/crypt/src/crypt.c
index 13b1bd96248..f43989bb901 100644
--- a/xlators/encryption/crypt/src/crypt.c
+++ b/xlators/encryption/crypt/src/crypt.c
@@ -3127,8 +3127,6 @@ static int32_t linkop_begin(call_frame_t *frame,
unwind_fn = linkop_unwind_dispatch(local->fop);
mop = linkop_mtdop_dispatch(local->fop);
- if (local->fd->inode->ia_type == IA_IFLNK)
- goto wind;
if (op_ret < 0)
/*
* verification failed
@@ -3230,9 +3228,6 @@ static int32_t linkop_begin(call_frame_t *frame,
0,
NULL);
return 0;
- wind:
- wind_fn(frame, this);
- return 0;
error:
local->op_ret = -1;
local->op_errno = op_errno;
@@ -3332,13 +3327,19 @@ static int32_t linkop(call_frame_t *frame,
dict_t *dict;
crypt_local_t *local;
void (*unwind_fn)(call_frame_t *frame);
+ void (*wind_fn)(call_frame_t *frame, xlator_t *this);
+ wind_fn = linkop_wind_dispatch(op);
unwind_fn = linkop_unwind_dispatch(op);
ret = linkop_grab_local(frame, this, oldloc, newloc, flags, xdata, op);
local = frame->local;
if (ret)
goto error;
+
+ if (local->fd->inode->ia_type == IA_IFLNK)
+ goto wind;
+
dict = dict_new();
if (!dict) {
gf_log(this->name, GF_LOG_ERROR, "Can not create dict");
@@ -3375,7 +3376,12 @@ static int32_t linkop(call_frame_t *frame,
dict);
dict_unref(dict);
return 0;
- error:
+
+wind:
+ wind_fn(frame, this);
+ return 0;
+
+error:
local->op_ret = -1;
local->op_errno = ret;
unwind_fn(frame);