IB/iser: Seperate iser_conn and iscsi_endpoint storage space
iser connection needs asynchronous cleanup completions which are triggered in ep_disconnect. As a result we are keeping the corresponding iscsi_endpoint structure hanging for no good reason. In order to avoid that, we seperate iser_conn from iscsi_endpoint storage space to have their destruction being independent. iscsi_endpoint will be destroyed at ep_disconnect stage, while the iser connection will wait for asynchronous completions to be released in an orderly fashion. Signed-off-by: Ariel Nahum <arieln@mellanox.com> Signed-off-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
parent
2ea32938f3
commit
0a6907588a
|
@ -596,19 +596,28 @@ iscsi_iser_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
|
||||||
struct iser_conn *ib_conn;
|
struct iser_conn *ib_conn;
|
||||||
struct iscsi_endpoint *ep;
|
struct iscsi_endpoint *ep;
|
||||||
|
|
||||||
ep = iscsi_create_endpoint(sizeof(*ib_conn));
|
ep = iscsi_create_endpoint(0);
|
||||||
if (!ep)
|
if (!ep)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
ib_conn = ep->dd_data;
|
ib_conn = kzalloc(sizeof(*ib_conn), GFP_KERNEL);
|
||||||
|
if (!ib_conn) {
|
||||||
|
err = -ENOMEM;
|
||||||
|
goto failure;
|
||||||
|
}
|
||||||
|
|
||||||
|
ep->dd_data = ib_conn;
|
||||||
ib_conn->ep = ep;
|
ib_conn->ep = ep;
|
||||||
iser_conn_init(ib_conn);
|
iser_conn_init(ib_conn);
|
||||||
|
|
||||||
err = iser_connect(ib_conn, NULL, dst_addr, non_blocking);
|
err = iser_connect(ib_conn, NULL, dst_addr, non_blocking);
|
||||||
if (err)
|
if (err)
|
||||||
return ERR_PTR(err);
|
goto failure;
|
||||||
|
|
||||||
return ep;
|
return ep;
|
||||||
|
failure:
|
||||||
|
iscsi_destroy_endpoint(ep);
|
||||||
|
return ERR_PTR(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -658,6 +667,7 @@ iscsi_iser_ep_disconnect(struct iscsi_endpoint *ep)
|
||||||
} else {
|
} else {
|
||||||
iser_conn_release(ib_conn);
|
iser_conn_release(ib_conn);
|
||||||
}
|
}
|
||||||
|
iscsi_destroy_endpoint(ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
static umode_t iser_attr_is_visible(int param_type, int param)
|
static umode_t iser_attr_is_visible(int param_type, int param)
|
||||||
|
|
|
@ -620,7 +620,7 @@ void iser_conn_release(struct iser_conn *ib_conn)
|
||||||
rdma_destroy_id(ib_conn->cma_id);
|
rdma_destroy_id(ib_conn->cma_id);
|
||||||
ib_conn->cma_id = NULL;
|
ib_conn->cma_id = NULL;
|
||||||
}
|
}
|
||||||
iscsi_destroy_endpoint(ib_conn->ep);
|
kfree(ib_conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue