From: Christoph Hellwig <hch@lst.de>
To: "Nicholas A. Bellinger" <nab@daterainc.com>
Cc: target-devel <target-devel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
Quinn Tran <quinn.tran@qlogic.com>,
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>,
Nicholas Bellinger <nab@linux-iscsi.org>
Subject: Re: [PATCH 1/2] target: Fix LUN_RESET active I/O handling for ACK_KREF
Date: Tue, 12 Jan 2016 16:20:59 +0100 [thread overview]
Message-ID: <20160112152059.GB2294@lst.de> (raw)
In-Reply-To: <1452594245-921-2-git-send-email-nab@daterainc.com>
> It also introduces SCF_ACK_KREF to determine when
> transport_cmd_finish_abort() needs to drop the second
> extra reference, ahead of calling target_put_sess_cmd()
> for the final kref_put(&se_cmd->cmd_kref).
It would be really useful to have all drivers follow that
ACK KREF model instead of needing to deal with driver
differences everywhere..
> Finally, move transport_put_cmd() release of SGL +
> TMR + extended CDB memory into target_free_cmd_mem()
> in order to avoid potential resource leaks in TMR
> ABORT_TASK + LUN_RESET code-paths. Also update
> target_release_cmd_kref() accordingly.
Sounds like that should be a separate patch.
> +/*
> + * Called with se_session->sess_cmd_lock held with irq disabled
> + */
Please enforce this in the code instead of the comments, e.g.
assert_spin_locked(&se_session->sess_cmd_lock);
WARN_ON_ONCE(!irqs_disabled());
> +static bool __target_check_io_state(struct se_cmd *se_cmd)
> +{
> + struct se_session *sess = se_cmd->se_sess;
> +
> + if (!sess)
> + return false;
Given that you expect the session lock to be held this doesn't
make sense.
> + /*
> + * Obtain cmd_kref and move to list for shutdown processing
> + * if se_cmd->cmd_kref is still active, the command has not
> + * already reached CMD_T_COMPLETE
> + */
This just explains what __target_check_io_state does, but no why.
I'd suggest to remove the comment as it doesn't add any value.
next prev parent reply other threads:[~2016-01-12 15:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-12 10:24 [PATCH 0/2] target: Fix LUN_RESET active I/O + TMR handling Nicholas A. Bellinger
2016-01-12 10:24 ` [PATCH 1/2] target: Fix LUN_RESET active I/O handling for ACK_KREF Nicholas A. Bellinger
2016-01-12 15:20 ` Christoph Hellwig [this message]
2016-01-12 16:32 ` Bart Van Assche
2016-01-13 8:34 ` Christoph Hellwig
2016-01-13 9:14 ` Nicholas A. Bellinger
2016-01-13 9:29 ` Christoph Hellwig
2016-01-23 1:45 ` Nicholas A. Bellinger
2016-01-12 10:24 ` [PATCH 2/2] target: Fix LUN_RESET active TMR descriptor handling Nicholas A. Bellinger
2016-01-12 15:25 ` Christoph Hellwig
2016-01-23 2:02 ` Nicholas A. Bellinger
2016-01-13 20:26 ` [PATCH 0/2] target: Fix LUN_RESET active I/O + TMR handling Quinn Tran
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=20160112152059.GB2294@lst.de \
--to=hch@lst.de \
--cc=agrover@redhat.com \
--cc=hare@suse.de \
--cc=himanshu.madhani@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@daterainc.com \
--cc=nab@linux-iscsi.org \
--cc=quinn.tran@qlogic.com \
--cc=sagig@mellanox.com \
--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.