diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/nsr-server/src/all-templates.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/xlators/cluster/nsr-server/src/all-templates.c b/xlators/cluster/nsr-server/src/all-templates.c index 7300973d5..5a62ae507 100644 --- a/xlators/cluster/nsr-server/src/all-templates.c +++ b/xlators/cluster/nsr-server/src/all-templates.c @@ -258,11 +258,13 @@ nsr_$NAME$_complete (call_frame_t *frame, void *cookie, xlator_t *this, #endif #if defined(NSR_CG_QUEUE) - nsr_inode_ctx_t *ictx = nsr_get_inode_ctx(this,local->fd->inode); + nsr_inode_ctx_t *ictx; nsr_local_t *next; - if (ictx) { - LOCK(&ictx->lock); - list_del(&local->qlinks); + if (local->qlinks.next != &local->qlinks) { + list_del(&local->qlinks); + ictx = nsr_get_inode_ctx(this,local->fd->inode); + if (ictx) { + LOCK(&ictx->lock); if (ictx->pending) { /* * TBD: dequeue *all* non-conflicting reqs @@ -287,7 +289,8 @@ nsr_$NAME$_complete (call_frame_t *frame, void *cookie, xlator_t *this, else { --(ictx->active); } - UNLOCK(&ictx->lock); + UNLOCK(&ictx->lock); + } } #endif |