From: Bart Van Assche <bart.vanassche@sandisk.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: "Nicholas A. Bellinger" <nab@daterainc.com>,
target-devel <target-devel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Sagi Grimberg <sagig@mellanox.com>,
Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
Andy Grover <agrover@redhat.com>,
Vasu Dev <vasu.dev@linux.intel.com>, Vu Pham <vu@mellanox.com>
Subject: Re: [PATCH 4/4] ib_srpt: Convert acl lookup to modern get_initiator_node_acl usage
Date: Fri, 8 Jan 2016 10:35:35 +0100 [thread overview]
Message-ID: <568F82E7.4020006@sandisk.com> (raw)
In-Reply-To: <1452244633.27508.21.camel@haakon3.risingtidesystems.com>
On 01/08/2016 10:17 AM, Nicholas A. Bellinger wrote:
> On Fri, 2016-01-08 at 09:52 +0100, Bart Van Assche wrote:
>> On 01/08/2016 08:15 AM, Nicholas A. Bellinger wrote:
>>> @@ -2574,24 +2558,18 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id,
>>>
>>> pr_debug("registering session %s\n", ch->sess_name);
>>>
>>> - nacl = srpt_lookup_acl(sport, ch->i_port_id);
>>> - if (!nacl) {
>>> + se_acl = core_tpg_get_initiator_node_acl(&sport->port_tpg_1, ch->sess_name);
>>> + if (!se_acl) {
>>> pr_info("Rejected login because no ACL has been"
>>> " configured yet for initiator %s.\n", ch->sess_name);
>>> rej->reason = cpu_to_be32(
>>> - SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED);
>>> + SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED);
>>> + transport_free_session(ch->sess);
>>> goto destroy_ib;
>>> }
>>> + ch->sess->se_node_acl = se_acl;
>>
>> This is a backwards-incompatible change. Today the ib_srpt target driver
>> accepts initiator port names with and without leading "0x". With this
>> change the "0x" prefix becomes mandatory.
>
> The internally ib_srpt formatted ch->sess_name already needs to match
> se_node_acl->initiatorname for se_node_acl->acl_group configfs group
> shutdown reference..
>
> How does this patch become a backworks-incompatible change for that..?
Hello Nic,
Personally I'm not that worried about this change but I wanted to report
it anyway. The current algorithm is as follows:
- When a directory is created in configfs for an initiator, the
initiator name is parsed and stored in binary form in struct
srpt_node_acl. The parsing function accepts both initiator
names that start with a "0x" prefix and initiator names that
do not have that prefix.
- During login the initiator port ID provided by the initiator in
the SRP login request is compared with the binary initiator port ID
in struct srpt_node_acl.
The patch at the start of this e-mail thread changes this behavior
because core_tpg_get_initiator_node_acl() looks up the initiator port ID
in a list that contains the ASCII representations of the initiator port
ID. This means that the initiator port name will only be found by
core_tpg_get_initiator_node_acl() if the name format used in the mkdir
command matches the initiator name format used by the
core_tpg_get_initiator_node_acl() caller, this means with "0x" prefix.
Bart.
Bart.
prev parent reply other threads:[~2016-01-08 9:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 7:15 [PATCH 0/4] target: Close se_node_acl lookup race Nicholas A. Bellinger
2016-01-08 7:15 ` [PATCH 1/4] target: Obtain se_node_acl->acl_kref during get_initiator_node_acl Nicholas A. Bellinger
2016-01-08 8:14 ` Christoph Hellwig
2016-01-08 8:31 ` Bart Van Assche
2016-01-08 8:35 ` Christoph Hellwig
2016-01-08 8:47 ` Nicholas A. Bellinger
2016-01-08 9:08 ` Christoph Hellwig
2016-01-08 9:37 ` Christoph Hellwig
2016-01-08 7:15 ` [PATCH 2/4] target: Remove useless set_initiator_node_queue_depth acl lookup Nicholas A. Bellinger
2016-01-08 8:17 ` Christoph Hellwig
2016-01-08 7:15 ` [PATCH 3/4] tcm_fc: Convert acl lookup to modern get_initiator_node_acl usage Nicholas A. Bellinger
2016-01-08 8:21 ` Christoph Hellwig
2016-01-08 9:05 ` Christoph Hellwig
2016-01-08 7:15 ` [PATCH 4/4] ib_srpt: " Nicholas A. Bellinger
2016-01-08 8:52 ` Bart Van Assche
2016-01-08 9:17 ` Nicholas A. Bellinger
2016-01-08 9:35 ` Bart Van Assche [this message]
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=568F82E7.4020006@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=agrover@redhat.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@daterainc.com \
--cc=nab@linux-iscsi.org \
--cc=sagig@mellanox.com \
--cc=target-devel@vger.kernel.org \
--cc=vasu.dev@linux.intel.com \
--cc=vu@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).