summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-02-13 16:49:06 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-20 14:06:14 -0500
commit6cf59d308371715704b397c851683490a897da8c (patch)
tree27018dc3f359196e051ff57e2f1eac58499a710b
parent14b26480e26dbb2e40db039c4fad95548247dddd (diff)
cluster/dht Fix error assignment in dht_*xattr2 functions
Corrected the op_errno assignments and NULL checks in the dht_sexattr2 and dht_removexattr2 functions. Earlier, they unwound with the default EINVAL op_errno if the file had been deleted. > Change-Id: Iaf837a473d769cea40132487a966c7f452990071 > BUG: 1421653 > Signed-off-by: N Balachandran <nbalacha@redhat.com> > Reviewed-on: https://review.gluster.org/16610 > Smoke: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: MOHIT AGRAWAL <moagrawa@redhat.com> > Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> (cherry picked from commit 028626a86ea409f908783b9007c02877f20be43e) Signed-off-by: N Balachandran <nbalacha@redhat.com> Change-Id: Icc53ca52281a533fc0c8eeafb4c889c818c313e1 BUG: 1424921 Reviewed-on: https://review.gluster.org/16679 Tested-by: N Balachandran <nbalacha@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 31bea00d203..697091cebc0 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -3935,6 +3935,7 @@ dht_setxattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
goto err;
local = frame->local;
+ op_errno = local->op_errno;
if (we_are_not_migrating (ret)) {
/* This dht xlator is not migrating the file. Unwind and
@@ -3949,7 +3950,6 @@ dht_setxattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
if (subvol == NULL)
goto err;
- op_errno = local->op_errno;
local->call_cnt = 2; /* This is the second attempt */
@@ -4358,10 +4358,11 @@ dht_removexattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame,
dht_local_t *local = NULL;
int op_errno = EINVAL;
- if (!frame || !frame->local || !subvol)
+ if (!frame || !frame->local)
goto err;
local = frame->local;
+ op_errno = local->op_errno;
local->call_cnt = 2; /* This is the second attempt */
@@ -4376,6 +4377,9 @@ dht_removexattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame,
return 0;
}
+ if (subvol == NULL)
+ goto err;
+
if (local->fop == GF_FOP_REMOVEXATTR) {
STACK_WIND_COOKIE (frame, dht_file_removexattr_cbk, subvol,
subvol, subvol->fops->removexattr,