All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	target-devel <target-devel@vger.kernel.org>
Cc: stable <stable@vger.kernel.org>,
	Greg-KH <gregkh@linuxfoundation.org>,
	Himanshu Madhani <himanshu.madhani@qlogic.com>,
	Sagi Grimberg <sagig@mellanox.com>,
	Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
	Andy Grover <agrover@redhat.com>,
	Mike Christie <mchristi@redhat.com>
Subject: Re: [PATCH-v3.14.y 4/8] target: Fix LUN_RESET active I/O handling for ACK_KREF
Date: Tue, 8 Mar 2016 16:08:54 +0100	[thread overview]
Message-ID: <56DEEB06.8020107@suse.cz> (raw)
In-Reply-To: <1457232926-1761-5-git-send-email-nab@linux-iscsi.org>

On 03/06/2016, 03:55 AM, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
> 
> [ Upstream commit febe562c20dfa8f33bee7d419c6b517986a5aa33 ]
...
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
...
> @@ -536,10 +533,6 @@ static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists,
>  {
>  	unsigned long flags;
>  
> -	spin_lock_irqsave(&cmd->t_state_lock, flags);
> -	if (write_pending)
> -		cmd->t_state = TRANSPORT_WRITE_PENDING;
> -

I tried to backport this to 3.12, but I think it is impossible to move
the lock below. The code still has this here:

        if (cmd->transport_state & CMD_T_LUN_STOP) {
                pr_debug("%s:%d CMD_T_LUN_STOP for ITT: 0x%08x\n",
                        __func__, __LINE__, cmd->se_tfo->get_task_tag(cmd));

                cmd->transport_state &= ~CMD_T_ACTIVE;
                if (remove_from_lists)
                        target_remove_from_state_list(cmd);
                spin_unlock_irqrestore(&cmd->t_state_lock, flags);

                complete(&cmd->transport_lun_stop_comp);
                return 1;
        }

And it seems transport_state needs the lock, right?

>  	if (remove_from_lists) {
>  		target_remove_from_state_list(cmd);
>  
> @@ -549,6 +542,10 @@ static int transport_cmd_check_stop(struct se_cmd *cmd, bool remove_from_lists,
>  		cmd->se_lun = NULL;
>  	}
>  
> +	spin_lock_irqsave(&cmd->t_state_lock, flags);
> +	if (write_pending)
> +		cmd->t_state = TRANSPORT_WRITE_PENDING;
> +
>  	/*
>  	 * Determine if frontend context caller is requesting the stopping of
>  	 * this command for frontend exceptions.

thanks,
-- 
js
suse labs

  reply	other threads:[~2016-03-08 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06  2:55 [PATCH-v3.14.y 0/8] target: stable backports Nicholas A. Bellinger
2016-03-06  2:55 ` [PATCH-v3.14.y 1/8] target: Fix Task Aborted Status (TAS) handling Nicholas A. Bellinger
2016-03-06  2:55 ` [PATCH-v3.14.y 2/8] target: Add TFO->abort_task for aborted task resources release Nicholas A. Bellinger
2016-03-06  2:55 ` [PATCH-v3.14.y 3/8] target: Fix LUN_RESET active TMR descriptor handling Nicholas A. Bellinger
2016-03-06  2:55 ` [PATCH-v3.14.y 4/8] target: Fix LUN_RESET active I/O handling for ACK_KREF Nicholas A. Bellinger
2016-03-08 15:08   ` Jiri Slaby [this message]
2016-03-10  5:59     ` Nicholas A. Bellinger
2016-03-14 11:59       ` Jiri Slaby
2016-03-06  2:55 ` [PATCH-v3.14.y 5/8] target: Fix TAS handling for multi-session se_node_acls Nicholas A. Bellinger
2016-03-06  2:55 ` [PATCH-v3.14.y 6/8] target: Fix remote-port TMR ABORT + se_cmd fabric stop Nicholas A. Bellinger
2016-03-06  2:55 ` [PATCH-v3.14.y 7/8] target: Fix race with SCF_SEND_DELAYED_TAS handling Nicholas A. Bellinger
2016-03-06  2:55 ` [PATCH-v3.14.y 8/8] target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors Nicholas A. Bellinger
2016-03-07 23:39 ` [PATCH-v3.14.y 0/8] target: stable backports Greg-KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56DEEB06.8020107@suse.cz \
    --to=jslaby@suse.cz \
    --cc=agrover@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=himanshu.madhani@qlogic.com \
    --cc=mchristi@redhat.com \
    --cc=nab@linux-iscsi.org \
    --cc=sagig@mellanox.com \
    --cc=stable@vger.kernel.org \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.