All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target:fix destory device in target_configure_device
@ 2018-01-15 12:09 tang.wenji
  2018-01-15 20:43 ` Mike Christie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tang.wenji @ 2018-01-15 12:09 UTC (permalink / raw)
  To: target-devel

From: tangwenji <tang.wenji@zte.com.cn>

After dev->transport->configure_device succeeds,target_configure_device
exits abnormally, dev_flags has not set DF_CONFIGURED yet, does not call
destory_device function in free_device

Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
---
 drivers/target/target_core_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index e8dd6da..18716fa 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -997,7 +997,7 @@ int target_configure_device(struct se_device *dev)
 
 	ret = core_setup_alua(dev);
 	if (ret)
-		goto out_free_index;
+		goto out_destory_device;
 
 	/*
 	 * Startup the struct se_device processing thread
@@ -1041,6 +1041,8 @@ int target_configure_device(struct se_device *dev)
 
 out_free_alua:
 	core_alua_free_lu_gp_mem(dev);
+out_destory_device:
+	dev->transport->destroy_device(dev);
 out_free_index:
 	mutex_lock(&device_mutex);
 	idr_remove(&devices_idr, dev->dev_index);
-- 
2.8.1.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] target:fix destory device in target_configure_device
  2018-01-15 12:09 [PATCH] target:fix destory device in target_configure_device tang.wenji
@ 2018-01-15 20:43 ` Mike Christie
  2018-01-16 16:04 ` Bart Van Assche
  2018-01-18  9:22 ` Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2018-01-15 20:43 UTC (permalink / raw)
  To: target-devel

On 01/15/2018 06:09 AM, tang.wenji@zte.com.cn wrote:
> From: tangwenji <tang.wenji@zte.com.cn>
> 
> After dev->transport->configure_device succeeds,target_configure_device
> exits abnormally, dev_flags has not set DF_CONFIGURED yet, does not call
> destory_device function in free_device
> 
> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
> ---
>  drivers/target/target_core_device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
> index e8dd6da..18716fa 100644
> --- a/drivers/target/target_core_device.c
> +++ b/drivers/target/target_core_device.c
> @@ -997,7 +997,7 @@ int target_configure_device(struct se_device *dev)
>  
>  	ret = core_setup_alua(dev);
>  	if (ret)
> -		goto out_free_index;
> +		goto out_destory_device;
>  
>  	/*
>  	 * Startup the struct se_device processing thread
> @@ -1041,6 +1041,8 @@ int target_configure_device(struct se_device *dev)
>  
>  out_free_alua:
>  	core_alua_free_lu_gp_mem(dev);
> +out_destory_device:
> +	dev->transport->destroy_device(dev);
>  out_free_index:
>  	mutex_lock(&device_mutex);
>  	idr_remove(&devices_idr, dev->dev_index);
> 

Looks ok to me.

Reviewed-by: Mike Christie <mchristi@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target:fix destory device in target_configure_device
  2018-01-15 12:09 [PATCH] target:fix destory device in target_configure_device tang.wenji
  2018-01-15 20:43 ` Mike Christie
@ 2018-01-16 16:04 ` Bart Van Assche
  2018-01-18  9:22 ` Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2018-01-16 16:04 UTC (permalink / raw)
  To: target-devel

T24gTW9uLCAyMDE4LTAxLTE1IGF0IDIwOjA5ICswODAwLCB0YW5nLndlbmppQHp0ZS5jb20uY24g
d3JvdGU6DQo+ICAJaWYgKHJldCkNCj4gLQkJZ290byBvdXRfZnJlZV9pbmRleDsNCj4gKwkJZ290
byBvdXRfZGVzdG9yeV9kZXZpY2U7DQoNCkhlbGxvIFRhbmcsDQoNClBsZWFzZSBmaXggdGhlIHNw
ZWxsaW5nIG9mICJkZXN0cm95Ii4NCg0KVGhhbmtzLA0KDQpCYXJ0Lg=

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target:fix destory device in target_configure_device
  2018-01-15 12:09 [PATCH] target:fix destory device in target_configure_device tang.wenji
  2018-01-15 20:43 ` Mike Christie
  2018-01-16 16:04 ` Bart Van Assche
@ 2018-01-18  9:22 ` Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2018-01-18  9:22 UTC (permalink / raw)
  To: target-devel

On Mon, 2018-01-15 at 14:43 -0600, Mike Christie wrote:
> On 01/15/2018 06:09 AM, tang.wenji@zte.com.cn wrote:
> > From: tangwenji <tang.wenji@zte.com.cn>
> > 
> > After dev->transport->configure_device succeeds,target_configure_device
> > exits abnormally, dev_flags has not set DF_CONFIGURED yet, does not call
> > destory_device function in free_device
> > 
> > Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
> > ---
> >  drivers/target/target_core_device.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 

Applied.  Thanks Tang + MNC.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-18  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-15 12:09 [PATCH] target:fix destory device in target_configure_device tang.wenji
2018-01-15 20:43 ` Mike Christie
2018-01-16 16:04 ` Bart Van Assche
2018-01-18  9:22 ` Nicholas A. Bellinger

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.