<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/lightnvm, branch v5.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-12-22T21:45:35Z</updated>
<entry>
<title>lightnvm: pblk: fix use-after-free bug</title>
<updated>2018-12-22T21:45:35Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2018-12-22T07:39:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d52c499b476b2f82eebecdd5fc4be8318a4e8ef7'/>
<id>urn:sha1:d52c499b476b2f82eebecdd5fc4be8318a4e8ef7</id>
<content type='text'>
Remove one of the calls to function bio_put(), so *bio* is only
freed once.

Notice that bio is being dereferenced in bio_put(), hence leading to
a use-after-free bug once *bio* has already been freed.

Addresses-Coverity-ID: 1475952 ("Use after free")
Fixes: 55d8ec35398e ("lightnvm: pblk: support packed metadata")
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: do not overwrite ppa list with meta list</title>
<updated>2018-12-11T19:22:35Z</updated>
<author>
<name>Igor Konopko</name>
<email>igor.j.konopko@intel.com</email>
</author>
<published>2018-12-11T19:16:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c4d5356e64d7d538f24c23045478330fae4a065'/>
<id>urn:sha1:2c4d5356e64d7d538f24c23045478330fae4a065</id>
<content type='text'>
Ehen using pblk with 0 sized metadata both ppa list and meta list
points to the same memory since pblk_dma_meta_size() returns 0 in
that case.

This patch fix that issue by ensuring that pblk_dma_meta_size()
always returns space equal to sizeof(struct pblk_sec_meta) and thus
ppa list and meta list points to different memory address.

Even that in that case drive does not really care about meta_list
pointer, this is the easiest way to fix that issue without introducing
changes in many places in the code just for 0 sized metadata case.

The same approach needs to be also done for pblk_get_sec_meta()
since we also cannot point to the same memory address in meta buffer
when we are using it for pblk recovery process

Reported-by: Hans Holmberg &lt;hans.holmberg@cnexlabs.com&gt;
Tested-by: Hans Holmberg &lt;hans.holmberg@cnexlabs.com&gt;
Signed-off-by: Igor Konopko &lt;igor.j.konopko@intel.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: support packed metadata</title>
<updated>2018-12-11T19:22:35Z</updated>
<author>
<name>Igor Konopko</name>
<email>igor.j.konopko@intel.com</email>
</author>
<published>2018-12-11T19:16:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55d8ec35398e7ab001989473cf6ed6f40b5ef4a6'/>
<id>urn:sha1:55d8ec35398e7ab001989473cf6ed6f40b5ef4a6</id>
<content type='text'>
pblk performs recovery of open lines by storing the LBA in the per LBA
metadata field. Recovery therefore only works for drives that has this
field.

This patch adds support for packed metadata, which store l2p mapping
for open lines in last sector of every write unit and enables drives
without per IO metadata to recover open lines.

After this patch, drives with OOB size &lt;16B will use packed metadata
and metadata size larger than16B will continue to use the device per
IO metadata.

Reviewed-by: Javier González &lt;javier@cnexlabs.com&gt;
Signed-off-by: Igor Konopko &lt;igor.j.konopko@intel.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: disable interleaved metadata</title>
<updated>2018-12-11T19:22:35Z</updated>
<author>
<name>Igor Konopko</name>
<email>igor.j.konopko@intel.com</email>
</author>
<published>2018-12-11T19:16:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a16816b9e462e8ee86a908606bde54b53cfeca80'/>
<id>urn:sha1:a16816b9e462e8ee86a908606bde54b53cfeca80</id>
<content type='text'>
Currently pblk only check the size of I/O metadata and does not take
into account if this metadata is in a separate buffer or interleaved
in a single metadata buffer.

In reality only the first scenario is supported, where second mode will
break pblk functionality during any IO operation.

This patch prevents pblk to be instantiated in case device only
supports interleaved metadata.

Reviewed-by: Javier González &lt;javier@cnexlabs.com&gt;
Signed-off-by: Igor Konopko &lt;igor.j.konopko@intel.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: dynamic DMA pool entry size</title>
<updated>2018-12-11T19:22:35Z</updated>
<author>
<name>Igor Konopko</name>
<email>igor.j.konopko@intel.com</email>
</author>
<published>2018-12-11T19:16:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=24828d0536bbedc9b265f2b01ffca99de3f6a7c7'/>
<id>urn:sha1:24828d0536bbedc9b265f2b01ffca99de3f6a7c7</id>
<content type='text'>
Currently lightnvm and pblk uses single DMA pool, for which the entry
size always is equal to PAGE_SIZE. The contents of each entry allocated
from the DMA pool consists of a PPA list (8bytes * 64), leaving
56bytes * 64 space for metadata. Since the metadata field can be bigger,
such as 128 bytes, the static size does not cover this use-case.

This patch adds support for I/O metadata above 56 bytes by changing DMA
pool size based on device meta size and allows pblk to use OOB metadata
&gt;=16B.

Reviewed-by: Javier González &lt;javier@cnexlabs.com&gt;
Signed-off-by: Igor Konopko &lt;igor.j.konopko@intel.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: add helpers for OOB metadata</title>
<updated>2018-12-11T19:22:35Z</updated>
<author>
<name>Igor Konopko</name>
<email>igor.j.konopko@intel.com</email>
</author>
<published>2018-12-11T19:16:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=faa79f27f0a46cd6c3ac3de5e7f3e142598217fc'/>
<id>urn:sha1:faa79f27f0a46cd6c3ac3de5e7f3e142598217fc</id>
<content type='text'>
pblk currently assumes that size of OOB metadata on drive is always
equal to size of pblk_sec_meta struct. This commit add helpers which will
allow to handle different sizes of OOB metadata on drive in the future.

After this patch only OOB metadata equal to 16 bytes is supported.

Reviewed-by: Javier González &lt;javier@cnexlabs.com&gt;
Signed-off-by: Igor Konopko &lt;igor.j.konopko@intel.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: move lba list to partial read context</title>
<updated>2018-12-11T19:22:34Z</updated>
<author>
<name>Igor Konopko</name>
<email>igor.j.konopko@intel.com</email>
</author>
<published>2018-12-11T19:16:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dd439496dfbcfee1eb1e0d14984f98acb2b84c16'/>
<id>urn:sha1:dd439496dfbcfee1eb1e0d14984f98acb2b84c16</id>
<content type='text'>
Currently DMA allocated memory is reused on partial read
for lba_list_mem and lba_list_media arrays. In preparation
for dynamic DMA pool sizes we need to move this arrays
into pblk_pr_ctx structures.

Reviewed-by: Javier González &lt;javier@cnexlabs.com&gt;
Signed-off-by: Igor Konopko &lt;igor.j.konopko@intel.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: avoid ref warning on cache creation</title>
<updated>2018-12-11T19:22:34Z</updated>
<author>
<name>Javier González</name>
<email>javier@javigon.com</email>
</author>
<published>2018-12-11T19:16:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=42bd0384d77ef7552954056928018f5cfa91a013'/>
<id>urn:sha1:42bd0384d77ef7552954056928018f5cfa91a013</id>
<content type='text'>
The current kref implementation around pblk global caches triggers a
false positive on refcount_inc_checked() (when called) as the kref is
initialized to 0. Instead of usint kref_inc() on a 0 reference, which is
in principle correct, use kref_init() to avoid the check. This is also
more explicit about what actually happens on cache creation.

In the process, do a small refactoring to use kref helpers.

Fixes: 1864de94ec9d6 "lightnvm: pblk: stop recreating global caches"
Signed-off-by: Javier González &lt;javier@cnexlabs.com&gt;
Reviewed-by: Hans Holmberg &lt;hans.holmberg@cnexlabs.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: simplify geometry enumeration</title>
<updated>2018-12-11T19:22:34Z</updated>
<author>
<name>Matias Bjørling</name>
<email>mb@lightnvm.io</email>
</author>
<published>2018-12-11T19:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=85136c0102852fe505c0fbd3f1bf9d17038bb94d'/>
<id>urn:sha1:85136c0102852fe505c0fbd3f1bf9d17038bb94d</id>
<content type='text'>
Currently the geometry of an OCSSD is enumerated using a two step
approach:

First, nvm_register is called, the OCSSD identify command is issued,
and second the geometry sos and csecs values are read either from the
OCSSD identify if it is a 1.2 drive, or from the NVMe namespace data
structure if it is a 2.0 device.

This patch recombines it into a single step, such that nvm_register can
use the csecs and sos fields independent of which version is used. This
enables one to dynamically size the lightnvm subsystem dma pool.

Reviewed-by: Igor Konopko &lt;igor.j.konopko@intel.com&gt;
Reviewed-by: Javier González &lt;javier@cnexlabs.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: add comments wrt locking in recovery path</title>
<updated>2018-12-11T19:22:34Z</updated>
<author>
<name>Javier González</name>
<email>javier@javigon.com</email>
</author>
<published>2018-12-11T19:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=361d889f830ef61e4eae442c4c89fb14b626375f'/>
<id>urn:sha1:361d889f830ef61e4eae442c4c89fb14b626375f</id>
<content type='text'>
pblk's recovery path is single threaded and therefore a number of
assumptions regarding concurrency can be made. To avoid confusion, make
this explicit with a couple of comments in the code.

Signed-off-by: Javier González &lt;javier@cnexlabs.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
