Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1379447

Re: [PATCH v4 1/2] scsi: Add intermediate STARGET_REMOVE state to scsi_target_state

From Xiong Zhou <jencce.kernel@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/2] scsi: Add intermediate STARGET_REMOVE state to scsi_target_state
Date 2016-04-15 05:30 +0200
Message-ID <ro2Ce-4Ew-3@gated-at.bofh.it> (permalink)
References <rkvWa-18w-9@gated-at.bofh.it> <rkvWc-18w-29@gated-at.bofh.it> <rn6eS-7VQ-17@gated-at.bofh.it> <rnobM-6Bj-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Apr 13, 2016 at 4:19 PM, Johannes Thumshirn <jthumshirn@suse.de> wrote:
> Hi Xiong
> Sorry for the late reply
>
> On Dienstag, 12. April 2016 21:01:53 CEST Xiong Zhou wrote:
>> How about this?
>>
>> drivers/scsi/scsi_scan: mark STARGET_REMOVE state before destroy
>>
>> Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
>> ---
>>  drivers/scsi/scsi_scan.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
>> index 27df7e7..21092e5 100644
>> --- a/drivers/scsi/scsi_scan.c
>> +++ b/drivers/scsi/scsi_scan.c
>> @@ -395,6 +395,8 @@ static void scsi_target_reap_ref_release(struct kref *kref)
>>   transport_remove_device(&starget->dev);
>>   device_del(&starget->dev);
>>   }
>> +
>> + starget->state = STARGET_REMOVE;
>>   scsi_target_destroy(starget);
>>  }
>
> The only scsi_target_reap_ref_release() caller is scsi_target_reap_ref_put(),
> which in turn is only called by scsi_target_reap(). scsi_target_reap()'s only
> callers are scsi_remove_target()/__scsi_remove_target(), which set the
> STARGET_REMOVE state and
>
> __scsi_add_device()
> scsi_get_host_dev()
> __scsi_scan_target()
>
> Which I'm currently investiganting (in parallel to reproducing the bug).

Thanks !

--
Xiong

>
>>
>> @@ -465,6 +467,7 @@ static struct scsi_target
>> *scsi_alloc_target(struct device *parent,
>>   dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error);
>>   /* don't want scsi_target_reap to do the final
>>   * put because it will be under the host lock */
>> + starget->state = STARGET_REMOVE;
>>   scsi_target_destroy(starget);
>>   return NULL;
>>   }
>
> Here starget->state is STARGET_CREATED and the assertion is already aware of
> this state transitoin. IOTW this /shouldn't/ be needed.
>
>
> --
> Johannes Thumshirn                                                                                Storage
> jthumshirn@suse.de                                                             +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/2] Update SCSI target removal path Johannes Thumshirn <jthumshirn@suse.de> - 2016-04-05 12:00 +0200
  [PATCH v4 1/2] scsi: Add intermediate STARGET_REMOVE state to scsi_target_state Johannes Thumshirn <jthumshirn@suse.de> - 2016-04-05 12:00 +0200
    Re: [PATCH v4 1/2] scsi: Add intermediate STARGET_REMOVE state to scsi_target_state Xiong Zhou <jencce.kernel@gmail.com> - 2016-04-12 07:40 +0200
    Re: [PATCH v4 1/2] scsi: Add intermediate STARGET_REMOVE state to scsi_target_state Xiong Zhou <jencce.kernel@gmail.com> - 2016-04-12 15:10 +0200
      Re: [PATCH v4 1/2] scsi: Add intermediate STARGET_REMOVE state to scsi_target_state Johannes Thumshirn <jthumshirn@suse.de> - 2016-04-13 10:20 +0200
        Re: [PATCH v4 1/2] scsi: Add intermediate STARGET_REMOVE state to scsi_target_state Xiong Zhou <jencce.kernel@gmail.com> - 2016-04-15 05:30 +0200
  [PATCH v4 2/2] Revert "scsi: fix soft lockup in scsi_remove_target() on module removal" Johannes Thumshirn <jthumshirn@suse.de> - 2016-04-05 12:00 +0200
  Re: [PATCH v4 0/2] Update SCSI target removal path "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-04-05 13:20 +0200
    Re: [PATCH v4 0/2] Update SCSI target removal path Johannes Thumshirn <jthumshirn@suse.de> - 2016-04-06 11:10 +0200

csiph-web