2022-03-08 23:08:41

by Mike Christie

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] scsi:libiscsi: teardown iscsi_cls_conn gracefully

On 3/8/22 9:09 PM, Wenchao Hao wrote:
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index ca724eed4f4d..7b4d998708e7 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -2165,6 +2165,7 @@ static int iscsi_iter_destroy_conn_fn(struct device *dev, void *data)
> {
> if (!iscsi_is_conn_dev(dev))
> return 0;
> + iscsi_remove_conn(iscsi_dev_to_conn(dev));
> return iscsi_destroy_conn(iscsi_dev_to_conn(dev));

Just do:

iscsi_remove_conn
iscsi_put_conn
return 0;



> }
>
> @@ -2463,7 +2464,7 @@ int iscsi_destroy_conn(struct iscsi_cls_conn *conn)
>
> transport_unregister_device(&conn->dev);
> ISCSI_DBG_TRANS_CONN(conn, "Completing conn destruction\n");
> - device_unregister(&conn->dev);
> + iscsi_free_conn(conn);
> return 0;
> }
> EXPORT_SYMBOL_GPL(iscsi_destroy_conn);