summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-inode-write.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2017-04-20 10:08:02 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-04-24 04:12:57 +0000
commitd60ca8e96bbc16b13f8f3456f30ebeb16d0d1e47 (patch)
tree960e60cc13515e2f91aff6232d6758819e506e96 /xlators/cluster/dht/src/dht-inode-write.c
parent05d9c5a3d684512e97327c8d73988ef7f29e1511 (diff)
cluster/dht: Pass the req dict instead of NULL in dht_attr2()
This bug was causing VMs to pause during rebalance. When qemu winds down a STAT, shard fills the trusted.glusterfs.shard.file-size attribute in the req dict which DHT doesn't wind its STAT fop with upon detecting the file has undergone migration. As a result shard doesn't find the value to this key in the unwind path, causing it to fail the STAT with EINVAL. Also, the same bug exists in other fops too, which is also fixed in this patch. Change-Id: Id7823fd932b4e5a9b8779ebb2b612a399c0ef5f0 BUG: 1440051 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: https://review.gluster.org/17085 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: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-inode-write.c')
-rw-r--r--xlators/cluster/dht/src/dht-inode-write.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c
index 93755b9703a..825822a27e6 100644
--- a/xlators/cluster/dht/src/dht-inode-write.c
+++ b/xlators/cluster/dht/src/dht-inode-write.c
@@ -144,7 +144,7 @@ dht_writev2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
local->fd, local->rebalance.vector,
local->rebalance.count,
local->rebalance.offset, local->rebalance.flags,
- local->rebalance.iobref, NULL);
+ local->rebalance.iobref, local->xattr_req);
return 0;
@@ -181,7 +181,8 @@ dht_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
op_errno = EINVAL;
goto err;
}
-
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
local->rebalance.vector = iov_dup (vector, count);
local->rebalance.offset = off;
@@ -324,11 +325,11 @@ dht_truncate2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
if (local->fop == GF_FOP_TRUNCATE) {
STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
subvol->fops->truncate, &local->loc,
- local->rebalance.offset, NULL);
+ local->rebalance.offset, local->xattr_req);
} else {
STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
subvol->fops->ftruncate, local->fd,
- local->rebalance.offset, NULL);
+ local->rebalance.offset, local->xattr_req);
}
return 0;
@@ -367,6 +368,8 @@ dht_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
op_errno = EINVAL;
goto err;
}
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
subvol->fops->truncate, loc, offset, xdata);
@@ -407,6 +410,8 @@ dht_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
op_errno = EINVAL;
goto err;
}
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
STACK_WIND_COOKIE (frame, dht_truncate_cbk, subvol, subvol,
subvol->fops->ftruncate, fd, offset, xdata);
@@ -533,7 +538,7 @@ dht_fallocate2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
STACK_WIND_COOKIE (frame, dht_fallocate_cbk, subvol, subvol,
subvol->fops->fallocate, local->fd,
local->rebalance.flags, local->rebalance.offset,
- local->rebalance.size, NULL);
+ local->rebalance.size, local->xattr_req);
return 0;
@@ -572,6 +577,8 @@ dht_fallocate(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t mode,
op_errno = EINVAL;
goto err;
}
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
STACK_WIND_COOKIE (frame, dht_fallocate_cbk, subvol, subvol,
subvol->fops->fallocate, fd, mode, offset, len,
@@ -699,7 +706,7 @@ dht_discard2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
STACK_WIND_COOKIE (frame, dht_discard_cbk, subvol, subvol,
subvol->fops->discard, local->fd,
local->rebalance.offset, local->rebalance.size,
- NULL);
+ local->xattr_req);
return 0;
@@ -737,6 +744,8 @@ dht_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
op_errno = EINVAL;
goto err;
}
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
STACK_WIND_COOKIE (frame, dht_discard_cbk, subvol, subvol,
subvol->fops->discard, fd, offset, len, xdata);
@@ -863,7 +872,7 @@ dht_zerofill2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
STACK_WIND_COOKIE (frame, dht_zerofill_cbk, subvol, subvol,
subvol->fops->zerofill,
local->fd, local->rebalance.offset,
- local->rebalance.size, NULL);
+ local->rebalance.size, local->xattr_req);
return 0;
@@ -902,6 +911,8 @@ dht_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
op_errno = EINVAL;
goto err;
}
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
STACK_WIND_COOKIE (frame, dht_zerofill_cbk, subvol, subvol,
subvol->fops->zerofill, fd, offset, len, xdata);
@@ -1006,12 +1017,12 @@ dht_setattr2 (xlator_t *this, xlator_t *subvol, call_frame_t *frame, int ret)
STACK_WIND_COOKIE (frame, dht_file_setattr_cbk, subvol,
subvol, subvol->fops->setattr, &local->loc,
&local->rebalance.stbuf, local->rebalance.flags,
- NULL);
+ local->xattr_req);
} else {
STACK_WIND_COOKIE (frame, dht_file_setattr_cbk, subvol,
subvol, subvol->fops->fsetattr, local->fd,
&local->rebalance.stbuf, local->rebalance.flags,
- NULL);
+ local->xattr_req);
}
return 0;
@@ -1104,6 +1115,8 @@ dht_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
op_errno = EINVAL;
goto err;
}
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
if (IA_ISREG (loc->inode->ia_type)) {
/* in the regular file _cbk(), we need to check for
@@ -1176,6 +1189,8 @@ dht_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
op_errno = EINVAL;
goto err;
}
+ if (xdata)
+ local->xattr_req = dict_ref (xdata);
if (IA_ISREG (fd->inode->ia_type)) {
/* in the regular file _cbk(), we need to check for