diff options
author | shishir gowda <shishirng@gluster.com> | 2011-11-10 16:39:31 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-16 01:54:34 -0800 |
commit | 3440b6d68a5e787a6a1baba2073ee0c44a9b1632 (patch) | |
tree | 1f664139a04ecdad268fc9eccbc276f9bedc2b1f /xlators/cluster/dht/src/dht-inode-write.c | |
parent | a3c49bb260263dce98d44c28e7106da2a2173ed9 (diff) |
cluster/distribute: Use local call_cnt while winding
layout->cnt might be modified in cbk's or different threads, which
will lead to corruptions
Change-Id: Icfdab01ac583cb3d27d62f878b79e0098b597952
BUG: 3730
Reviewed-on: http://review.gluster.com/694
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-inode-write.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-inode-write.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c index f9dea75aa21..4f65b46713c 100644 --- a/xlators/cluster/dht/src/dht-inode-write.c +++ b/xlators/cluster/dht/src/dht-inode-write.c @@ -480,6 +480,7 @@ dht_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dht_local_t *local = NULL; int op_errno = -1; int i = -1; + int call_cnt = 0; VALIDATE_OR_GOTO (frame, err); VALIDATE_OR_GOTO (this, err); @@ -523,9 +524,9 @@ dht_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, return 0; } - local->call_cnt = layout->cnt; + local->call_cnt = call_cnt = layout->cnt; - for (i = 0; i < layout->cnt; i++) { + for (i = 0; i < call_cnt; i++) { STACK_WIND (frame, dht_setattr_cbk, layout->list[i].xlator, layout->list[i].xlator->fops->setattr, @@ -551,6 +552,7 @@ dht_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, dht_local_t *local = NULL; int op_errno = -1; int i = -1; + int call_cnt = 0; VALIDATE_OR_GOTO (frame, err); @@ -593,9 +595,9 @@ dht_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf, return 0; } - local->call_cnt = layout->cnt; + local->call_cnt = call_cnt = layout->cnt; - for (i = 0; i < layout->cnt; i++) { + for (i = 0; i < call_cnt; i++) { STACK_WIND (frame, dht_setattr_cbk, layout->list[i].xlator, layout->list[i].xlator->fops->fsetattr, |