Commit ea174c95 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Doug Ledford
Browse files

RDMA/iser: Fix possible mr leak on device removal event

When the rdma device is removed, we must cleanup all
the rdma resources within the DEVICE_REMOVAL event
handler to let the device teardown gracefully. When
this happens with live I/O, some memory regions are
occupied. Thus, track them too and dereg all the mr's.

We are safe with mr access by iscsi_iser_cleanup_task.

Reported-by: default avatarRaju Rangoju <>
Signed-off-by: default avatarSagi Grimberg <>
Reviewed-by: default avatarMax Gurtovoy <>
Reviewed-by: default avatarMax Gurtovoy <>
Signed-off-by: default avatarDoug Ledford <>
parent b7363e67
......@@ -430,6 +430,7 @@ struct iser_fr_desc {
struct list_head list;
struct iser_reg_resources rsc;
struct iser_pi_context *pi_ctx;
struct list_head all_list;
......@@ -443,6 +444,7 @@ struct iser_fr_pool {
struct list_head list;
spinlock_t lock;
int size;
struct list_head all_list;
......@@ -362,6 +362,7 @@ int iser_alloc_fastreg_pool(struct ib_conn *ib_conn,
int i, ret;
fr_pool->size = 0;
for (i = 0; i < cmds_max; i++) {
......@@ -373,6 +374,7 @@ int iser_alloc_fastreg_pool(struct ib_conn *ib_conn,
list_add_tail(&desc->list, &fr_pool->list);
list_add_tail(&desc->all_list, &fr_pool->all_list);
......@@ -392,13 +394,13 @@ void iser_free_fastreg_pool(struct ib_conn *ib_conn)
struct iser_fr_desc *desc, *tmp;
int i = 0;
if (list_empty(&fr_pool->list))
if (list_empty(&fr_pool->all_list))
iser_info("freeing conn %p fr pool\n", ib_conn);
list_for_each_entry_safe(desc, tmp, &fr_pool->list, list) {
list_for_each_entry_safe(desc, tmp, &fr_pool->all_list, all_list) {
if (desc->pi_ctx)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment