<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/nvme/target, branch linux-6.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-05-30T07:48:56Z</updated>
<entry>
<title>nvmet: prevent sprintf() overflow in nvmet_subsys_nsid_exists()</title>
<updated>2024-05-30T07:48:56Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2024-05-08T07:43:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a06725cb75110f0c0ae39fb8fb2f7104142224c5'/>
<id>urn:sha1:a06725cb75110f0c0ae39fb8fb2f7104142224c5</id>
<content type='text'>
[ Upstream commit d15dcd0f1a4753b57e66c64c8dc2a9779ff96aab ]

The nsid value is a u32 that comes from nvmet_req_find_ns().  It's
endian data and we're on an error path and both of those raise red
flags.  So let's make this safer.

1) Make the buffer large enough for any u32.
2) Remove the unnecessary initialization.
3) Use snprintf() instead of sprintf() for even more safety.
4) The sprintf() function returns the number of bytes printed, not
   counting the NUL terminator. It is impossible for the return value to
   be &lt;= 0 so delete that.

Fixes: 505363957fad ("nvmet: fix nvme status code when namespace is disabled")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet: fix nvme status code when namespace is disabled</title>
<updated>2024-05-30T07:48:55Z</updated>
<author>
<name>Sagi Grimberg</name>
</author>
<published>2024-04-28T09:25:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dffd29d230b76d2b42300c6436d478d933113546'/>
<id>urn:sha1:dffd29d230b76d2b42300c6436d478d933113546</id>
<content type='text'>
[ Upstream commit 505363957fad35f7aed9a2b0d8dad73451a80fb5 ]

If the user disabled a nvmet namespace, it is removed from the subsystem
namespaces list. When nvmet processes a command directed to an nsid that
was disabled, it cannot differentiate between a nsid that is disabled
vs. a non-existent namespace, and resorts to return NVME_SC_INVALID_NS
with the dnr bit set.

This translates to a non-retryable status for the host, which translates
to a user error. We should expect disabled namespaces to not cause an
I/O error in a multipath environment.

Address this by searching a configfs item for the namespace nvmet failed
to find, and if we found one, conclude that the namespace is disabled
(perhaps temporarily). Return NVME_SC_INTERNAL_PATH_ERROR in this case
and keep DNR bit cleared.

Reported-by: Jirong Feng &lt;jirong.feng@easystack.cn&gt;
Tested-by: Jirong Feng &lt;jirong.feng@easystack.cn&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-tcp: fix possible memory leak when tearing down a controller</title>
<updated>2024-05-30T07:48:55Z</updated>
<author>
<name>Sagi Grimberg</name>
</author>
<published>2024-04-28T08:49:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=34f20131bd404e331c839d68aa6df28d611c8845'/>
<id>urn:sha1:34f20131bd404e331c839d68aa6df28d611c8845</id>
<content type='text'>
[ Upstream commit 6825bdde44340c5a9121f6d6fa25cc885bd9e821 ]

When we teardown the controller, we wait for pending I/Os to complete
(sq-&gt;ref on all queues to drop to zero) and then we go over the commands,
and free their command buffers in case they are still fetching data from
the host (e.g. processing nvme writes) and have yet to take a reference
on the sq.

However, we may miss the case where commands have failed before executing
and are queued for sending a response, but will never occur because the
queue socket is already down. In this case we may miss deallocating command
buffers.

Solve this by freeing all commands buffers as nvmet_tcp_free_cmd_buffers is
idempotent anyways.

Reported-by: Yi Zhang &lt;yi.zhang@redhat.com&gt;
Tested-by: Yi Zhang &lt;yi.zhang@redhat.com&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-auth: replace pr_debug() with pr_err() to report an error.</title>
<updated>2024-05-30T07:48:55Z</updated>
<author>
<name>Maurizio Lombardi</name>
</author>
<published>2024-04-10T09:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2e10fc83897bab8fbfe787458e2e278b68a93368'/>
<id>urn:sha1:2e10fc83897bab8fbfe787458e2e278b68a93368</id>
<content type='text'>
[ Upstream commit 445f9119e70368ccc964575c2a6d3176966a9d65 ]

In nvmet_auth_host_hash(), if a mismatch is detected in the hash length
the kernel should print an error.

Signed-off-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-auth: return the error code to the nvmet_auth_host_hash() callers</title>
<updated>2024-05-30T07:48:55Z</updated>
<author>
<name>Maurizio Lombardi</name>
</author>
<published>2024-04-10T09:48:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19abd26d8cb0806348921e9f2d5ba3162279de34'/>
<id>urn:sha1:19abd26d8cb0806348921e9f2d5ba3162279de34</id>
<content type='text'>
[ Upstream commit 46b8f9f74f6d500871985e22eb19560b21f3bc81 ]

If the nvmet_auth_host_hash() function fails, the error code should
be returned to its callers.

Signed-off-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet: remove superfluous initialization</title>
<updated>2024-02-13T23:42:44Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2024-02-13T07:58:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d30528a170905ede9ab6ab81f229e441808590b'/>
<id>urn:sha1:8d30528a170905ede9ab6ab81f229e441808590b</id>
<content type='text'>
Remove superfluous initialization of status variable in
nvmet_execute_admin_connect() and nvmet_execute_io_connect(), since it
will get overwritten by nvmet_copy_from_sgl().

Signed-off-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: use RCU list iterator for assoc_list</title>
<updated>2024-02-01T15:44:52Z</updated>
<author>
<name>Daniel Wagner</name>
</author>
<published>2024-01-31T08:51:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a90ac7b348770ff3d246fac575306783de381e51'/>
<id>urn:sha1:a90ac7b348770ff3d246fac575306783de381e51</id>
<content type='text'>
The assoc_list is a RCU protected list, thus use the RCU flavor of list
functions.

Let's use this opportunity and refactor this code and move the lookup
into a helper and give it a descriptive name.

Signed-off-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: take ref count on tgtport before delete assoc</title>
<updated>2024-02-01T15:44:52Z</updated>
<author>
<name>Daniel Wagner</name>
</author>
<published>2024-01-31T08:51:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe506a74589326183297d5abdda02d0c76ae5a8b'/>
<id>urn:sha1:fe506a74589326183297d5abdda02d0c76ae5a8b</id>
<content type='text'>
We have to ensure that the tgtport is not going away
before be have remove all the associations.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: avoid deadlock on delete association path</title>
<updated>2024-02-01T15:44:52Z</updated>
<author>
<name>Daniel Wagner</name>
</author>
<published>2024-01-31T08:51:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=710c69dbaccdac312e32931abcb8499c1525d397'/>
<id>urn:sha1:710c69dbaccdac312e32931abcb8499c1525d397</id>
<content type='text'>
When deleting an association the shutdown path is deadlocking because we
try to flush the nvmet_wq nested. Avoid this by deadlock by deferring
the put work into its own work item.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-fc: abort command when there is no binding</title>
<updated>2024-02-01T15:44:51Z</updated>
<author>
<name>Daniel Wagner</name>
</author>
<published>2024-01-31T08:51:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3146345c2e9c2f661527054e402b0cfad80105a4'/>
<id>urn:sha1:3146345c2e9c2f661527054e402b0cfad80105a4</id>
<content type='text'>
When the target port has not active port binding, there is no point in
trying to process the command as it has to fail anyway. Instead adding
checks to all commands abort the command early.

Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
</feed>
