All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: target-devel@vger.kernel.org, Varun Prakash <varun@chelsio.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/6] target/iscsi: Call .iscsit_release_cmd() once
Date: Sun, 02 Apr 2017 15:59:05 -0700	[thread overview]
Message-ID: <1491173945.8846.48.camel@haakon3.risingtidesystems.com> (raw)
In-Reply-To: <20170330171244.8346-3-bart.vanassche@sandisk.com>

On Thu, 2017-03-30 at 10:12 -0700, Bart Van Assche wrote:
> While releasing a command __iscsit_free_cmd() can be called multiple
> times but .iscsit_release_cmd() must be called only once. Hence move
> the .iscsit_release_cmd() call into iscsit_release_cmd(). The latter
> function is only called once per command. The only driver that defines
> the .iscsit_release_cmd() callback is the cxgbit driver so this change
> only affects the cxgbit driver.
> 
> Fixes: 7ec811a8e9c3 ("iscsi-target: add void (*iscsit_release_cmd)()")
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Varun Prakash <varun@chelsio.com>
> Cc: Nicholas Bellinger <nab@linux-iscsi.org>
> Cc: <stable@vger.kernel.org>
> ---
>  drivers/target/iscsi/iscsi_target_util.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 

Applied to target-pending/for-next, but dropping the stable CC' because
the single caller in cxgbit_release_cmd() is already checking to ensure
resources are only released on the first invocation.

So it's not a bug-fix.

> diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c
> index 5041a9c8bdcb..8a022b5b2317 100644
> --- a/drivers/target/iscsi/iscsi_target_util.c
> +++ b/drivers/target/iscsi/iscsi_target_util.c
> @@ -691,11 +691,17 @@ void iscsit_release_cmd(struct iscsi_cmd *cmd)
>  {
>  	struct iscsi_session *sess;
>  	struct se_cmd *se_cmd = &cmd->se_cmd;
> +	struct iscsi_conn *conn = cmd->conn;
> +	void (*release)(struct iscsi_conn *, struct iscsi_cmd *);
>  
> -	if (cmd->conn)
> -		sess = cmd->conn->sess;
> -	else
> +	if (conn) {
> +		sess = conn->sess;
> +		release = conn->conn_transport->iscsit_release_cmd;
> +		if (release)
> +			release(conn, cmd);
> +	} else {
>  		sess = cmd->sess;
> +	}
>  
>  	BUG_ON(!sess || !sess->se_sess);

Also, no need for a local (*release) function pointer and extra
assignment.

Dropping that part now, and squashing into the original patch.

  reply	other threads:[~2017-04-02 22:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170330171244.8346-1-bart.vanassche@sandisk.com>
2017-03-30 17:12 ` [PATCH 1/6] target: Fix VERIFY and WRITE VERIFY command parsing Bart Van Assche
2017-04-02 22:43   ` Nicholas A. Bellinger
2017-03-30 17:12 ` [PATCH 2/6] target/iscsi: Call .iscsit_release_cmd() once Bart Van Assche
2017-04-02 22:59   ` Nicholas A. Bellinger [this message]
2017-04-04  5:06     ` Varun Prakash
2017-04-13  7:44       ` Varun Prakash
2017-05-02  4:33         ` Nicholas A. Bellinger
2017-05-07 12:52           ` Varun Prakash
2017-05-09  7:49             ` Nicholas A. Bellinger
2017-05-10 16:03               ` Varun Prakash
2017-11-01  0:07       ` Bart Van Assche
2017-11-01  0:07         ` Bart Van Assche
2017-11-06 15:38         ` Varun Prakash

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=1491173945.8846.48.camel@haakon3.risingtidesystems.com \
    --to=nab@linux-iscsi.org \
    --cc=bart.vanassche@sandisk.com \
    --cc=stable@vger.kernel.org \
    --cc=target-devel@vger.kernel.org \
    --cc=varun@chelsio.com \
    /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.