<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/nvme/target/fc.c, branch v5.16</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.16</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.16'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-06-17T13:51:19+00:00</updated>
<entry>
<title>nvmet-fc: do not check for invalid target port in nvmet_fc_handle_fcp_rqst()</title>
<updated>2021-06-17T13:51:19+00:00</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@suse.de</email>
</author>
<published>2021-05-25T12:54:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a4a910aa4f0acc428dc8d10227c42e14ed21d10'/>
<id>urn:sha1:2a4a910aa4f0acc428dc8d10227c42e14ed21d10</id>
<content type='text'>
When parsing a request in nvmet_fc_handle_fcp_rqst() we should not
check for invalid target ports; if we do the command is aborted
from the fcp layer, causing the host to assume a transport error.
Rather we should still forward this request to the nvmet layer, which
will then correctly fail the command with an appropriate error status.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: simplify nvmet_fc_alloc_hostport</title>
<updated>2021-04-15T06:12:53+00:00</updated>
<author>
<name>Amit Engel</name>
<email>amit.engel@dell.com</email>
</author>
<published>2021-03-22T19:57:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0d8ddeea11d00010c8b0ecbe9d3b90811cd19867'/>
<id>urn:sha1:0d8ddeea11d00010c8b0ecbe9d3b90811cd19867</id>
<content type='text'>
Once a host is already created, avoid allocate additional hostports that
will be thrown away. add an helper function to handle host search.

Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Amit Engel &lt;amit.engel@dell.com&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: update function documentation</title>
<updated>2021-04-02T16:48:27+00:00</updated>
<author>
<name>Chaitanya Kulkarni</name>
<email>chaitanya.kulkarni@wdc.com</email>
</author>
<published>2021-03-01T02:06:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b53d47418d98dbf5cd082e756a9e4e2a426492d7'/>
<id>urn:sha1:b53d47418d98dbf5cd082e756a9e4e2a426492d7</id>
<content type='text'>
Add minimum description of the hosthandle parameter for
nvmet_fc_rcv_ls_req() so that we can get rid of the following warning.

drivers/nvme//target/fc.c:2009: warning: Function parameter or member 'hosthandle' not described in 'nvmet_fc_rcv_ls_req

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Reviewed-by: James Smart &lt;jsmart2021@gmail.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: add a missing __rcu annotation to nvmet_fc_tgt_assoc.queues</title>
<updated>2021-02-10T15:38:04+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-02-07T16:17:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5df8e79a293739f031f25eb45de350165033ea4'/>
<id>urn:sha1:b5df8e79a293739f031f25eb45de350165033ea4</id>
<content type='text'>
Make sparse happy after the recent conversion to RCU lookups.

Fixes: 4e2f02bf77da ("nvmet-fc: use RCU proctection for assoc_list")
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Reviewed-by: James Smart &lt;james.smart@broadcom.com&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: use RCU proctection for assoc_list</title>
<updated>2021-02-02T09:26:10+00:00</updated>
<author>
<name>Leonid Ravich</name>
<email>Leonid.Ravich@emc.com</email>
</author>
<published>2021-01-03T18:12:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e2f02bf77dac7b8c841f93ae5a71556d733cb04'/>
<id>urn:sha1:4e2f02bf77dac7b8c841f93ae5a71556d733cb04</id>
<content type='text'>
searching assoc_list protected by rcu_read_lock if list not changed inline.
and according to the rcu list rules.

queue array embedded into nvmet_fc_tgt_assoc protected by rcu_read_lock
according to rcu dereference/assign rules.

queue and assoc object freed after grace period by call_rcu.

tgtport lock taken for changing assoc_list.

Reviewed-by: Eldad Zinger &lt;Eldad.Zinger@dell.com&gt;
Reviewed-by: Elad Grupi &lt;Elad.Grupi@dell.com&gt;
Reviewed-by: James Smart &lt;james.smart@broadcom.com&gt;
Signed-off-by: Leonid Ravich &lt;Leonid.Ravich@emc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: fix missing check for no hostport struct</title>
<updated>2020-09-27T07:14:19+00:00</updated>
<author>
<name>James Smart</name>
<email>james.smart@broadcom.com</email>
</author>
<published>2020-09-22T21:54:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ddd3d1051797b9f907ab9799f5ba50398c530676'/>
<id>urn:sha1:ddd3d1051797b9f907ab9799f5ba50398c530676</id>
<content type='text'>
A hostport port pointer is allowed to be NULL as it is not allocated if
the lldd does not support the new interfaces for NVME LS request support.
The hostport free routine validates the handle but forgot to validate the
hostport pointer.

Validate the hostport pointer before using it to validate the handle.

Signed-off-by: James Smart &lt;james.smart@broadcom.com&gt;
Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: Fix a missed _irqsave version of spin_lock in 'nvmet_fc_fod_op_done()'</title>
<updated>2020-08-28T23:43:57+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2020-08-21T07:58:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=70e37988db94aba607d5491a94f80ba08e399b6b'/>
<id>urn:sha1:70e37988db94aba607d5491a94f80ba08e399b6b</id>
<content type='text'>
The way 'spin_lock()' and 'spin_lock_irqsave()' are used is not consistent
in this function.

Use 'spin_lock_irqsave()' also here, as there is no guarantee that
interruptions are disabled at that point, according to surrounding code.

Fixes: a97ec51b37ef ("nvmet_fc: Rework target side abort handling")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: remove redundant del_work_active flag</title>
<updated>2020-07-29T05:45:20+00:00</updated>
<author>
<name>James Smart</name>
<email>jsmart2021@gmail.com</email>
</author>
<published>2020-07-24T16:40:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ece0278c1c96905c53a6cbb253927530fc707cfa'/>
<id>urn:sha1:ece0278c1c96905c53a6cbb253927530fc707cfa</id>
<content type='text'>
The transport has a del_work_active flag to avoid duplicate scheduling
of the del_work item. This is redundant with the checks that
schedule_work() makes.

Remove the del_work_active flag.

Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: check successful reference in nvmet_fc_find_target_assoc</title>
<updated>2020-07-29T05:45:20+00:00</updated>
<author>
<name>James Smart</name>
<email>jsmart2021@gmail.com</email>
</author>
<published>2020-07-24T16:40:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34efa23234c8b55dd178bba2216ca9ae9b50e1c9'/>
<id>urn:sha1:34efa23234c8b55dd178bba2216ca9ae9b50e1c9</id>
<content type='text'>
When searching for an association based on an association id, when there
is a match, the code takes a reference. However, it is not validating
that the reference taking was successful.

Check the status of the reference. If unsuccessful, the device is being
deleted and should be ignored.

Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: slight cleanup for kbuild test warnings</title>
<updated>2020-05-09T22:18:35+00:00</updated>
<author>
<name>James Smart</name>
<email>jsmart2021@gmail.com</email>
</author>
<published>2020-04-06T23:55:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e4fcc72c1a420bdbe425530dd19724214ceb44ec'/>
<id>urn:sha1:e4fcc72c1a420bdbe425530dd19724214ceb44ec</id>
<content type='text'>
The kbuild tst robot flagged the following 3 issues:

Case 1)
&gt;&gt; drivers/nvme/target/fc.c:1201:37: warning: Either the condition
&gt;&gt; '!assoc' is redundant or there is possible null pointer dereference:
&gt;&gt; assoc. [nullPointerRedundantCheck]
&gt;&gt;  struct nvmet_fc_tgtport *tgtport = assoc-&gt;tgtport;
                                       ^
&gt;&gt; drivers/nvme/target/fc.c:1853:7: note: Assuming that condition '!assoc'
&gt;&gt; is not redundant
&gt;&gt;   if (!assoc)
         ^
&gt;&gt; drivers/nvme/target/fc.c:1850:37: note: Assignment
&gt;&gt; 'assoc=nvmet_fc_find_target_assoc(tgtport,be64_to_cpu(
&gt;&gt;              rqst-&gt;associd.association_id))', assigned value is 0
&gt;&gt;   assoc = nvmet_fc_find_target_assoc(tgtport,
                                       ^
&gt;&gt; drivers/nvme/target/fc.c:1896:31: note: Calling function
&gt;&gt; 'nvmet_fc_delete_target_assoc', 1st argument 'assoc' value is 0
&gt;&gt;  nvmet_fc_delete_target_assoc(assoc);
                                 ^

The tool isn't smart enough to see that line 1854 sets a ret value which
thereafter causes the routine to exit. This occurs before any of the assoc
references, so it is not an issue. There are 2 more reportings of this
same failure.

To quiet the tool - rework the if test that does the exit to also
reference assoc.  No change in logic otherwise.

Case 2)
drivers/nvme/target/fc.c:1202:29: warning: The scope of the variable
'queue' can be reduced. [variableScope]
    struct nvmet_fc_tgt_queue *queue;
                               ^

The tool is requesting the variable be declared within the code block
that utilizes it. Ignoring this report as existing code style is fine.

Case 3)
drivers/nvme/target/fc.c:1137:16: warning: Variable 'needrandom' is
assigned a value that is never used. [unreadVariable]
       needrandom = true;
                  ^

Another parsing issue with the tool. Given that parens were not used
with the list_for_each_entry() check, it inadvertantly thinks the
break exited the outer while loop not the inner for loop.

This is not an error. But, added parens to the inner list_for_each_entry()
to quiet the tool and as it is better coding style.

-- james

Signed-off-by: James Smart &lt;jsmart2021@gmail.com&gt;
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
CC: kbuild test robot &lt;lkp@intel.com&gt;
CC: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
