From 9e72c9badea00f6ae9c4776a679632bdff7cf8c8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Dec 2009 17:59:44 +0000 Subject: [PATCH] Bug fix: SRQ availability counter is no longer decremented when ib_post_send() fails. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1388 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index f787eb401..4800b5c16 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -781,7 +781,6 @@ static int srpt_post_send(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx, ret = -ENOMEM; if (atomic_dec_return(&ch->qp_wr_avail) < 0) { - atomic_inc(&ch->qp_wr_avail); PRINT_ERROR("%s[%d]: SRQ full", __func__, __LINE__); goto out; } @@ -803,6 +802,8 @@ static int srpt_post_send(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx, ret = ib_post_send(ch->qp, &wr, &bad_wr); out: + if (ret < 0) + atomic_inc(&ch->qp_wr_avail); return ret; }