summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-09-05 15:18:58 +0530
committerjiffin tony Thottan <jthottan@redhat.com>2017-09-10 18:32:02 +0000
commit4afdac2043ee50f71601196da97af0027b0a8daf (patch)
tree645a0c68587cdcfdc0d0d93c668a83176cb53c4a
parent30d787f05fef4c2bd7b0f4a293f683603dca28e6 (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 > 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> (cherry picked from commit 47188e9eac59de416a5c86c7ec7540ed6aaa1c98) Signed-off-by: Ravishankar N <ravishankar@redhat.com> Change-Id: Iab4999e213bf2065804f3f8237e470ad454e3c99 BUG: 1489260 Reviewed-on: https://review.gluster.org/18222 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: N Balachandran <nbalacha@redhat.com>
-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 5392ee4..9709acf 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;