summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-09-05 15:18:58 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-09-07 02:17:04 +0000
commit47188e9eac59de416a5c86c7ec7540ed6aaa1c98 (patch)
tree11c7fc4ef6b1fb211ba3d6a15eb3fbb81de1b965 /xlators/cluster
parentecef90aa414a4dcb0a0d520be2334f03d06a4451 (diff)
dht: add FOP check to dht_file_setattr_cbk
Problem: bug-797171.7 loaded error-gen xlator on the brick which sent EBADF for a non fd-based fop, namely setattr. This caused dht_check_and_open_fd_on_subvol_task() to crash as local->fd was NULL. Fix: Call dht_check_and_open_fd_on_subvol_task() from dht_file_setattr_cbk only for dht_fsetattr and not dht_setattr or dht_setattr2 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Change-Id: Iab4999e213bf2065804f3f8237e470ad454e3c99 BUG: 1488399 Reviewed-on: https://review.gluster.org/18208 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Susant Palai <spalai@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: N Balachandran <nbalacha@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-inode-write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c
index 5392ee4635b..9709acfebb7 100644
--- a/xlators/cluster/dht/src/dht-inode-write.c
+++ b/xlators/cluster/dht/src/dht-inode-write.c
@@ -1034,8 +1034,8 @@ dht_file_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->op_errno = op_errno;
- if ((op_ret == -1) && (op_errno == EBADF)
- && !(local->fd_checked)) {
+ if ((local->fop == GF_FOP_FSETATTR) &&
+ (op_ret == -1) && (op_errno == EBADF) && !(local->fd_checked)) {
ret = dht_check_and_open_fd_on_subvol (this, frame);
if (ret)
goto out;