From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Mitko Haralanov
<mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 06/12] IB/hfi1: Don't remove list entries if they are not in a list
Date: Tue, 12 Apr 2016 10:46:23 -0700 [thread overview]
Message-ID: <20160412174621.19295.7133.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20160412173504.19295.7241.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
From: Mitko Haralanov <mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
The SDMA cache logic maintains an eviction list which is ordered
by most recently used user buffers. Upon errors or buffer freeing,
the list nodes were unconditionally being deleted. This would lead
to list corruption warnings if the nodes were never inserted in the
eviction list to begin with.
This commit prevents this by checking that the nodes are already
part of the eviction list.
Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Mitko Haralanov <mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/staging/rdma/hfi1/user_sdma.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c
index d53a659..032949b 100644
--- a/drivers/staging/rdma/hfi1/user_sdma.c
+++ b/drivers/staging/rdma/hfi1/user_sdma.c
@@ -1135,7 +1135,8 @@ retry:
ret = hfi1_mmu_rb_insert(&req->pq->sdma_rb_root, &node->rb);
if (ret) {
spin_lock(&pq->evict_lock);
- list_del(&node->list);
+ if (!list_empty(&node->list))
+ list_del(&node->list);
pq->n_locked -= node->npages;
spin_unlock(&pq->evict_lock);
ret = 0;
@@ -1558,7 +1559,8 @@ static void sdma_rb_remove(struct rb_root *root, struct mmu_rb_node *mnode,
container_of(mnode, struct sdma_mmu_node, rb);
spin_lock(&node->pq->evict_lock);
- list_del(&node->list);
+ if (!list_empty(&node->list))
+ list_del(&node->list);
node->pq->n_locked -= node->npages;
spin_unlock(&node->pq->evict_lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-04-12 17:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 17:45 [PATCH 00/12] IB/hfi1, IB/rdmavt, IB/qib: Important bug fixes for 4.6 RC Dennis Dalessandro
[not found] ` <20160412173504.19295.7241.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-04-12 17:45 ` [PATCH 01/12] IB/rdmavt: Fix adaptive pio hang Dennis Dalessandro
2016-04-12 17:45 ` [PATCH 02/12] IB/hfi1: Prevent NULL pointer deferences in caching code Dennis Dalessandro
2016-04-12 17:46 ` [PATCH 03/12] IB/hfi1: Fix deadlock caused by locking with wrong scope Dennis Dalessandro
2016-04-12 17:46 ` [PATCH 04/12] IB/qib, IB/hfi1: Fix up UD loopback use of irq flags Dennis Dalessandro
2016-04-12 17:46 ` [PATCH 05/12] IB/hfi1: Prevent unpinning of wrong pages Dennis Dalessandro
2016-04-12 17:46 ` Dennis Dalessandro [this message]
2016-04-12 17:46 ` [PATCH 07/12] IB/hfi1: Fix memory leak in user ExpRcv and SDMA Dennis Dalessandro
2016-04-12 17:46 ` [PATCH 08/12] IB/hfi1: Protect the interval RB tree when cleaning up Dennis Dalessandro
2016-04-12 17:46 ` [PATCH 09/12] IB/hfi1: Correctly compute node interval Dennis Dalessandro
2016-04-12 17:46 ` [PATCH 10/12] IB/hfi1: Extract and reinsert MMU RB node on lookup Dennis Dalessandro
2016-04-12 17:46 ` [PATCH 11/12] IB/hfi1: Fix buffer cache races which may cause corruption Dennis Dalessandro
2016-04-12 17:47 ` [PATCH 12/12] IB/rdmavt: Fix send scheduling Dennis Dalessandro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160412174621.19295.7133.stgit@scvm10.sc.intel.com \
--to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mitko.haralanov-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.