<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/nvme/target/loop.c, branch linux-5.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-05-25T07:59:01Z</updated>
<entry>
<title>nvmet: use a private workqueue instead of the system workqueue</title>
<updated>2022-05-25T07:59:01Z</updated>
<author>
<name>Sagi Grimberg</name>
</author>
<published>2022-03-21T11:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=84026f8c9357c62a9d3e4c554ffd10ccab813654'/>
<id>urn:sha1:84026f8c9357c62a9d3e4c554ffd10ccab813654</id>
<content type='text'>
[ Upstream commit 8832cf922151e9dfa2821736beb0ae2dd3968b6e ]

Any attempt to flush kernel-global WQs has possibility of deadlock
so we should simply stop using them, instead introduce nvmet_wq
which is the generic nvmet workqueue for work elements that
don't explicitly require a dedicated workqueue (by the mere fact
that they are using the system_wq).

Changes were done using the following replaces:

 - s/schedule_work(/queue_work(nvmet_wq, /g
 - s/schedule_delayed_work(/queue_delayed_work(nvmet_wq, /g
 - s/flush_scheduled_work()/flush_workqueue(nvmet_wq)/g

Reported-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.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>nvme: loop: clear NVME_CTRL_ADMIN_Q_STOPPED after admin queue is reallocated</title>
<updated>2021-10-20T00:27:58Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2021-10-14T08:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d35d519d8bf224ccdb43f9a235b8bda2d6d453c'/>
<id>urn:sha1:1d35d519d8bf224ccdb43f9a235b8bda2d6d453c</id>
<content type='text'>
The nvme-loop's admin queue may be freed and reallocated, and we have to
reset the flag of NVME_CTRL_ADMIN_Q_STOPPED so that the flag can match
with the quiesce state of the admin queue.

nvme-loop is the only driver to reallocate request queue, and not see
such usage in other nvme drivers.

Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/20211014081710.1871747-6-ming.lei@redhat.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>nvme: apply nvme API to quiesce/unquiesce admin queue</title>
<updated>2021-10-20T00:27:58Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2021-10-14T08:17:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ca1d9027e0d9ce5604a3e28de89456a76138034'/>
<id>urn:sha1:6ca1d9027e0d9ce5604a3e28de89456a76138034</id>
<content type='text'>
Apply the added two APIs to quiesce/unquiesce admin queue.

Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Link: https://lore.kernel.org/r/20211014081710.1871747-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>nvme: code command_id with a genctr for use-after-free validation</title>
<updated>2021-08-16T12:42:22Z</updated>
<author>
<name>Sagi Grimberg</name>
</author>
<published>2021-06-16T21:19:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e7006de6c23803799be000a5dcce4d916a36541a'/>
<id>urn:sha1:e7006de6c23803799be000a5dcce4d916a36541a</id>
<content type='text'>
We cannot detect a (perhaps buggy) controller that is sending us
a completion for a request that was already completed (for example
sending a completion twice), this phenomenon was seen in the wild
a few times.

So to protect against this, we use the upper 4 msbits of the nvme sqe
command_id to use as a 4-bit generation counter and verify it matches
the existing request generation that is incrementing on every execution.

The 16-bit command_id structure now is constructed by:
| xxxx | xxxxxxxxxxxx |
  gen    request tag

This means that we are giving up some possible queue depth as 12 bits
allow for a maximum queue depth of 4095 instead of 65536, however we
never create such long queues anyways so no real harm done.

Suggested-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Acked-by: Keith Busch &lt;kbusch@kernel.org&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Tested-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme: use blk_execute_rq() for passthrough commands</title>
<updated>2021-06-30T21:35:38Z</updated>
<author>
<name>Keith Busch</name>
</author>
<published>2021-06-10T21:44:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be42a33b9252f0b3857cadb896e430ee17cccad4'/>
<id>urn:sha1:be42a33b9252f0b3857cadb896e430ee17cccad4</id>
<content type='text'>
The generic blk_execute_rq() knows how to handle polled completions. Use
that instead of implementing an nvme specific handler.

Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Chaitanya Kulkarni &lt;chaitanya.kulkarni@wdc.com&gt;
Link: https://lore.kernel.org/r/20210610214437.641245-3-kbusch@kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>nvme-loop: do not warn for deleted controllers during reset</title>
<updated>2021-06-02T07:06:53Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2021-05-26T15:23:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6622f9acd29cd4f6272720e827e6406f5a970cb0'/>
<id>urn:sha1:6622f9acd29cd4f6272720e827e6406f5a970cb0</id>
<content type='text'>
During concurrent reset and delete calls the reset workqueue is
flushed, causing nvme_loop_reset_ctrl_work() to be executed when
the controller is in state DELETING or DELETING_NOIO.
But this is expected, so we shouldn't issue a WARN_ON here.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>nvme-loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue()</title>
<updated>2021-06-02T07:06:53Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2021-05-26T15:23:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4237de2f73a669e4f89ac0aa2b44fb1a1d9ec583'/>
<id>urn:sha1:4237de2f73a669e4f89ac0aa2b44fb1a1d9ec583</id>
<content type='text'>
We need to check the NVME_LOOP_Q_LIVE flag in
nvme_loop_destroy_admin_queue() to protect against duplicate
invocations eg during concurrent reset and remove calls.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&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>nvme-loop: clear NVME_LOOP_Q_LIVE when nvme_loop_configure_admin_queue() fails</title>
<updated>2021-06-02T07:06:53Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2021-05-26T15:23:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1c5f8e882a05de5c011e8c3fbeceb0d1c590eb53'/>
<id>urn:sha1:1c5f8e882a05de5c011e8c3fbeceb0d1c590eb53</id>
<content type='text'>
When the call to nvme_enable_ctrl() in nvme_loop_configure_admin_queue()
fails the NVME_LOOP_Q_LIVE flag is not cleared.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&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>nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues()</title>
<updated>2021-06-02T07:06:53Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2021-05-26T15:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6c144f3d2e230f2b3ac5ed8c51e0f0391556197'/>
<id>urn:sha1:a6c144f3d2e230f2b3ac5ed8c51e0f0391556197</id>
<content type='text'>
The queue count is increased in nvme_loop_init_io_queues(), so we
need to reset it to 1 at the end of nvme_loop_destroy_io_queues().
Otherwise the function is not re-entrant safe, and crash will happen
during concurrent reset and remove calls.

Signed-off-by: Hannes Reinecke &lt;hare@suse.de&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>nvme-loop: fix memory leak in nvme_loop_create_ctrl()</title>
<updated>2021-05-19T06:33:42Z</updated>
<author>
<name>Wu Bo</name>
</author>
<published>2021-05-19T05:01:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03504e3b54cc8118cc26c064e60a0b00c2308708'/>
<id>urn:sha1:03504e3b54cc8118cc26c064e60a0b00c2308708</id>
<content type='text'>
When creating loop ctrl in nvme_loop_create_ctrl(), if nvme_init_ctrl()
fails, the loop ctrl should be freed before jumping to the "out" label.

Fixes: 3a85a5de29ea ("nvme-loop: add a NVMe loopback host driver")
Signed-off-by: Wu Bo &lt;wubo40@huawei.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
