<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/nvme/target/admin-cmd.c, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-05-22T09:43:50Z</updated>
<entry>
<title>nvmet: remove unsupported command noise</title>
<updated>2021-05-22T09:43:50Z</updated>
<author>
<name>Keith Busch</name>
</author>
<published>2021-04-29T04:25:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8eed4c71b159887a73675080466ad2c21e5f6df4'/>
<id>urn:sha1:8eed4c71b159887a73675080466ad2c21e5f6df4</id>
<content type='text'>
[ Upstream commit 4a20342572f66c5b20a1ee680f5ac0a13703748f ]

Nothing can stop a host from submitting invalid commands. The target
just needs to respond with an appropriate status, but that's not a
target error. Demote invalid command messages to the debug level so
these events don't spam the kernel logs.

Reported-by: Yi Zhang &lt;yi.zhang@redhat.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Reviewed-by: Klaus Jensen &lt;k.jensen@samsung.com&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet: avoid queuing keep-alive timer if it is disabled</title>
<updated>2021-05-12T06:39:53Z</updated>
<author>
<name>Hou Pu</name>
</author>
<published>2021-04-16T02:45:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=284d899d90004213794f45c5506020d7782e9150'/>
<id>urn:sha1:284d899d90004213794f45c5506020d7782e9150</id>
<content type='text'>
[ Upstream commit 8f864c595bed20ef85fef3e7314212b73800d51d ]

Issue following command:
nvme set-feature -f 0xf -v 0 /dev/nvme1n1 # disable keep-alive timer
nvme admin-passthru -o 0x18 /dev/nvme1n1  # send keep-alive command
will make keep-alive timer fired and thus delete the controller like
below:

[247459.907635] nvmet: ctrl 1 keep-alive timer (0 seconds) expired!
[247459.930294] nvmet: ctrl 1 fatal error occurred!

Avoid this by not queuing delayed keep-alive if it is disabled when
keep-alive command is received from the admin queue.

Signed-off-by: Hou Pu &lt;houpu.main@gmail.com&gt;
Tested-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet: model_number must be immutable once set</title>
<updated>2021-03-05T12:41:03Z</updated>
<author>
<name>Max Gurtovoy</name>
</author>
<published>2021-02-17T17:19:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9f273b7585c380d7a10d4b3187ddc2d37f2740b'/>
<id>urn:sha1:d9f273b7585c380d7a10d4b3187ddc2d37f2740b</id>
<content type='text'>
In case we have already established connection to nvmf target, it
shouldn't be allowed to change the model_number. E.g. if someone will
identify ctrl and get model_number of "my_model" later on will change
the model_numbel via configfs to "my_new_model" this will break the NVMe
specification for "Get Log Page – Persistent Event Log" that refers to
Model Number as: "This field contains the same value as reported in the
Model Number field of the Identify Controller data structure, bytes
63:24."

Although it doesn't mentioned explicitly that this field can't be
changed, we can assume it.

So allow setting this field only once: using configfs or in the first
identify ctrl operation.

Signed-off-by: Max Gurtovoy &lt;mgurtovoy@nvidia.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: add nvmet_req_subsys() helper</title>
<updated>2021-02-10T15:38:05Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:48:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20c2c3bb83f26c42bf62cc773f96f30848ed11a2'/>
<id>urn:sha1:20c2c3bb83f26c42bf62cc773f96f30848ed11a2</id>
<content type='text'>
Just like what we have to get the passthru ctrl from the req, add an
helper to get the subsystem associated with the nvmet_req() instead
of open coding the chain of structures.

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: remove extra variable in id-ns handler</title>
<updated>2021-02-10T15:38:04Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:47:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3999434b6ce6fa452128c36cbb5017f0cd347615'/>
<id>urn:sha1:3999434b6ce6fa452128c36cbb5017f0cd347615</id>
<content type='text'>
In nvmet_execute_identify_ns() local variable ctrl is accessed only in
one place, remove that and directly use it from nvmet_req-&gt;sq-&gt;ctrl.

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: make nvmet_find_namespace() req based</title>
<updated>2021-02-10T15:38:04Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:47:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238'/>
<id>urn:sha1:3a1f7c79ae6d3dfdc16082daa44b3cf8dbe4f238</id>
<content type='text'>
The six callers of nvmet_find_namespace() duplicate the error log page
update and status setting code for each call on failure.

All callers are nvmet requests based functions, so we can pass req
to the nvmet_find_namesapce() &amp; derive ctrl from req, that'll allow us
to update the error log page in nvmet_find_namespace(). Now that we
pass the request we can also get rid of the local variable in
nvmet_find_namespace() and use the req-&gt;ns and return the error code.

Replace the ctrl parameter with nvmet_req for nvmet_find_namespace(),
centralize the error log page update for non allocated namesapces, and
return uniform error for non-allocated namespace.

The nvmet_find_namespace() takes nsid parameter which is from NVMe
commands structures such as get_log_page, identify, rw and common. All
these commands have same offset for the nsid field.

Derive nsid from req-&gt;cmd-&gt;common.nsid) &amp; remove the extra parameter
from the nvmet_find_namespace().

Lastly now we associate the ns to the req parameter that we pass to the
nvmet_find_namespace(), rename nvmet_find_namespace() to
nvmet_req_find_ns().

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: return uniform error for invalid ns</title>
<updated>2021-02-10T15:38:04Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:47:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa0aff604a60627b9f6c51c99dd5f63634322668'/>
<id>urn:sha1:aa0aff604a60627b9f6c51c99dd5f63634322668</id>
<content type='text'>
For nvmet_find_namespace() error case we have inconsistent error code
mapping in the function nvmet_get_smart_log_nsid() and
nvmet_set_feat_write_protect().

There is no point in retrying for the invalid namesapce from the host
side. Set the error code to the NVME_SC_INVALID_NS | NVME_SC_DNR which
matches what we have in nvmet_execute_identify_desclist().

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: set status to 0 in case for invalid nsid</title>
<updated>2021-02-10T15:38:04Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-02-10T05:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=40244ad36bcfb796a6bb9e95bdcbf8ddf3134509'/>
<id>urn:sha1:40244ad36bcfb796a6bb9e95bdcbf8ddf3134509</id>
<content type='text'>
For unallocated namespace in nvmet_execute_identify_ns() don't set the
status to NVME_SC_INVALID_NS, set it to zero.

Fixes: bffcd507780e ("nvmet: set right status on error in id-ns handler")
Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvmet: remove extra variable in identify ns</title>
<updated>2021-02-02T09:26:11Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-01-14T01:33:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c7b224f1956ed232b24ed2eb2c54e4476c6acb2'/>
<id>urn:sha1:3c7b224f1956ed232b24ed2eb2c54e4476c6acb2</id>
<content type='text'>
We remove the extra local variable struct nvmet_ns in
nvmet_execute_identify_ns() since req already has ns member that can be
reused, this also eliminates the explicit call to nvmet_put_namespace()
which is already present in the request completion path.

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.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: remove extra variable in id-desclist</title>
<updated>2021-02-02T09:26:11Z</updated>
<author>
<name>Chaitanya Kulkarni</name>
</author>
<published>2021-01-14T01:33:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3631c7f4a24165b9431942b85b502454edb0c33b'/>
<id>urn:sha1:3631c7f4a24165b9431942b85b502454edb0c33b</id>
<content type='text'>
We remove the extra local variable struct nvmet_ns in
nvmet_execute_identify_desclist() since req already has ns member that
can be reused, this also eliminates the explicit call to
nvmet_put_namespace() which is already present in the request
completion path.

Signed-off-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
