Re: [PATCH v2 20/36] target: Simplify session shutdown code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -	if (sess->sess_tearing_down || se_cmd->cmd_wait_set) {
> +	if (sess->sess_tearing_down) {
>  		pr_debug("Attempted to abort io tag: %llu already shutdown,"
>  			" skipping\n", se_cmd->tag);
>  		spin_unlock(&se_cmd->t_state_lock);
> @@ -247,7 +247,7 @@ static void core_tmr_drain_tmr_list(
>  			spin_unlock(&sess->sess_cmd_lock);
>  			continue;
>  		}
> -		if (sess->sess_tearing_down || cmd->cmd_wait_set) {
> +		if (sess->sess_tearing_down) {

If se_cmd->cmd_wait_set is set, sess->sess_tearing_down must always
be set as well, so these are a trivially correct cleanup.  Maybe
split this into a separate prep patch?

>  	init_completion(&cmd->finished);
>  	spin_lock_init(&cmd->t_state_lock);
>  	kref_init(&cmd->cmd_kref);
> @@ -2538,16 +2537,6 @@ int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks)
>  		if (cmd->se_lun)
>  			transport_lun_remove_cmd(cmd);
>  	}
> -	/*
> -	 * If the task has been internally aborted due to TMR ABORT_TASK
> -	 * or LUN_RESET, target_core_tmr.c is responsible for performing
> -	 * the remaining calls to target_put_sess_cmd(), and not the
> -	 * callers of this function.
> -	 */
> -	if (aborted) {
> -		pr_debug("Detected CMD_T_ABORTED for ITT: %llu\n", cmd->tag);
> -		wait_for_completion(&cmd->cmd_wait_comp);
> -	}

Previously this waited for the command to be freed from the TMR code,
which provided a synchronization point.  I don't think it's useful,
but it should be mentioned in the changelog.

Except for that the patch looks fine to me:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux