diff options
author | Raghavendra G <raghavendra@gluster.com> | 2012-05-19 14:49:21 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-05-23 06:38:24 -0700 |
commit | 2606b87470e396e3e79269764e01f572da051e41 (patch) | |
tree | 03fc1f3754eeb82f58b77c5ef513ae9c1c23a051 /xlators/performance/quick-read/src/quick-read.h | |
parent | bb8a0664ef36809d8b8e75fcb973a2089e5d08a6 (diff) |
performance/quick-read: fix race-conditions in qr_unlink.
The list of fds on which open needs to be done as part of unlink,
was being modified at different places using different locks.
This resulted in a race-condition where open was marked as in-transit,
but fdctx was removed from the list of fds on which open was being
sent even before open was done. Because of this, open_in_transit would
be set forever (as an open was never actually sent, there would be no
open_cbk called and hence we could not reset the variable), blocking
all the future fd based fops on this fd.
Change-Id: Ie84a55bee578869a9a060a094ba28480e7643ae8
BUG: 819490
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3371
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/performance/quick-read/src/quick-read.h')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.h b/xlators/performance/quick-read/src/quick-read.h index 28f43a8bcb6..10a04e79c14 100644 --- a/xlators/performance/quick-read/src/quick-read.h +++ b/xlators/performance/quick-read/src/quick-read.h @@ -44,7 +44,6 @@ struct qr_fd_ctx { struct list_head waiting_ops; gf_lock_t lock; struct list_head inode_list; - struct list_head tmp_list; fd_t *fd; dict_t *xdata; }; @@ -60,7 +59,7 @@ struct qr_local { int32_t op_errno; uint32_t open_count; call_stub_t *stub; - struct list_head fd_list; + struct list_head list; gf_lock_t lock; }; typedef struct qr_local qr_local_t; @@ -106,6 +105,13 @@ struct qr_private { }; typedef struct qr_private qr_private_t; +struct qr_unlink_ctx { + struct list_head list; + qr_fd_ctx_t *fdctx; + char need_open; +}; +typedef struct qr_unlink_ctx qr_unlink_ctx_t; + void qr_local_free (qr_local_t *local); #define QR_STACK_UNWIND(op, frame, params ...) do { \ |