<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/lightnvm, branch linux-4.20.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.20.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.20.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-02-12T19:02:18+00:00</updated>
<entry>
<title>lightnvm: Fix uninitialized return value in nvm_get_chunk_meta()</title>
<updated>2019-02-12T19:02:18+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2018-12-11T19:16:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8fcd2eb827e14b49785db87ec704f6a8e08a6c2c'/>
<id>urn:sha1:8fcd2eb827e14b49785db87ec704f6a8e08a6c2c</id>
<content type='text'>
[ Upstream commit 55e58c5e78aad9d3246f57e7718cf5ee7adde9e3 ]

With gcc 4.1:

    drivers/lightnvm/core.c: In function ‘nvm_get_bb_meta’:
    drivers/lightnvm/core.c:977: warning: ‘ret’ may be used uninitialized in this function

and

    drivers/nvme/host/lightnvm.c: In function ‘nvme_nvm_get_chk_meta’:
    drivers/nvme/host/lightnvm.c:580: warning: ‘ret’ may be used uninitialized in this function

Indeed, if (for the former) the number of channels or LUNs is zero, or
(for both) the passed number of chunks is zero, ret will be returned
uninitialized.

Fix this by preinitializing ret to zero.

Fixes: aff3fb18f957de93 ("lightnvm: move bad block and chunk state logic to core")
Fixes: a294c199455187d1 ("lightnvm: implement get log report chunk helpers")
Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: add lock protection to list operations</title>
<updated>2019-02-12T19:02:18+00:00</updated>
<author>
<name>Hua Su</name>
<email>suhua.tanke@gmail.com</email>
</author>
<published>2018-12-11T19:16:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=521b8625eefb1cc1dde1621d9d7b5892a64af031'/>
<id>urn:sha1:521b8625eefb1cc1dde1621d9d7b5892a64af031</id>
<content type='text'>
[ Upstream commit fde201a466c6ad5efd72cb54fdf2cefa8b6c6ad7 ]

Protect the list_add on the pblk_line_init_bb() error
path in case this code is used for some other purpose
in the future.

Signed-off-by: Hua Su &lt;suhua.tanke@gmail.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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: fix resubmission of overwritten write err lbas</title>
<updated>2019-02-12T19:02:18+00:00</updated>
<author>
<name>Hans Holmberg</name>
<email>hans.holmberg@cnexlabs.com</email>
</author>
<published>2018-12-11T19:16:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=11dd6d2155296700959615360ea086c215db58db'/>
<id>urn:sha1:11dd6d2155296700959615360ea086c215db58db</id>
<content type='text'>
[ Upstream commit c12fa401ac8c94a74aff68bb5736b3f1dc695fa8 ]

Make sure we only look up valid lba addresses on the resubmission path.

If an lba is invalidated in the write buffer, that sector will be
submitted to disk (as it is already mapped to a ppa), and that write
might fail, resulting in a crash when trying to look up the lba in the
mapping table (as the lba is marked as invalid).

Signed-off-by: Hans Holmberg &lt;hans.holmberg@cnexlabs.com&gt;
Reviewed-by: Javier González &lt;javier@javigon.com&gt;
Signed-off-by: Matias Bjørling &lt;mb@lightnvm.io&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>lightnvm: pblk: guarantee that backpointer is respected on writer stall</title>
<updated>2018-10-09T14:25:08+00:00</updated>
<author>
<name>Javier González</name>
<email>javier@javigon.com</email>
</author>
<published>2018-10-09T11:12:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=766c8ceb16fce904d6b8985ca2c0a547e053d1d5'/>
<id>urn:sha1:766c8ceb16fce904d6b8985ca2c0a547e053d1d5</id>
<content type='text'>
pblk's write buffer must guarantee that it respects the device's
constrains for reads (i.e., mw_cunits). This is done by maintaining a
backpointer that updates the L2P table as entries wrap up, making them
point to the media instead of pointing to the write buffer.

This mechanism can race in case that the write thread stalls, as the
write pointer will protect the last written entry, thus disregarding the
read constrains.

This patch adds an extra check on wrap up, making sure that the
threshold is respected at all times, preventing new entries to overwrite
committed data, also in case of write thread stall.

Reported-by: Heiner Litz &lt;hlitz@ucsc.edu&gt;
Signed-off-by: Javier González &lt;javier@cnexlabs.com&gt;
Reviewed-by: Heiner Litz &lt;hlitz@ucsc.edu&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: consider max hw sectors supported for max_write_pgs</title>
<updated>2018-10-09T14:25:08+00:00</updated>
<author>
<name>Zhoujie Wu</name>
<email>zjwu@marvell.com</email>
</author>
<published>2018-10-09T11:12:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a57fc3823d08edb1661a06d9e0a8c2365ac561e'/>
<id>urn:sha1:8a57fc3823d08edb1661a06d9e0a8c2365ac561e</id>
<content type='text'>
When do GC, the number of read/write sectors are determined
by max_write_pgs(see gc_rq preparation in pblk_gc_line_prepare_ws).

Due to max_write_pgs doesn't consider max hw sectors
supported by nvme controller(128K), which leads to GC
tries to read 64 * 4K in one command, and see below error
caused by pblk_bio_map_addr in function pblk_submit_read_gc.

[ 2923.005376] pblk: could not add page to bio
[ 2923.005377] pblk: could not allocate GC bio (18446744073709551604)

Signed-off-by: Zhoujie Wu &lt;zjwu@marvell.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: fix error handling of pblk_lines_init()</title>
<updated>2018-10-09T14:25:08+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2018-10-09T11:12:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a70985f83c625a5eaf618be81621e5e4521a66c6'/>
<id>urn:sha1:a70985f83c625a5eaf618be81621e5e4521a66c6</id>
<content type='text'>
In the too many bad blocks error handling case, we should release all
the allocated resources, otherwise it will cause memory leak.

Fixes: 2deeefc02dff ("lightnvm: pblk: fail gracefully on line alloc. failure")
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.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: pblk: guarantee mw_cunits on read buffer</title>
<updated>2018-10-09T14:25:08+00:00</updated>
<author>
<name>Javier González</name>
<email>javier@javigon.com</email>
</author>
<published>2018-10-09T11:12:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d672d92d9c433c365fd6cdb4da1c02562b5f1178'/>
<id>urn:sha1:d672d92d9c433c365fd6cdb4da1c02562b5f1178</id>
<content type='text'>
OCSSD 2.0 defines the amount of data that the host must buffer per chunk
to guarantee reads through the geometry field mw_cunits. This value is
the base that pblk uses to determine the size of its read buffer.
Currently, this size is set to be the closes power-of-2 to mw_cunits
times the number of parallel units available to the pblk instance for
each open line (currently one). When an entry (4KB) is put in the
buffer, the L2P table points to it. As the buffer wraps up, the L2P is
updated to point to addresses on the device, thus guaranteeing mw_cunits
at a chunk level.

However, given that pblk cannot write to the device under ws_min
(normally ws_opt), there might be a window in which the buffer starts
wrapping up and updating L2P entries before the mw_cunits value in a
chunk has been surpassed.

In order not to violate the mw_cunits constrain in this case, account
for ws_opt on the read buffer creation.

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>
<entry>
<title>lightnvm: pblk: move ring buffer alloc/free rb init</title>
<updated>2018-10-09T14:25:08+00:00</updated>
<author>
<name>Javier González</name>
<email>javier@javigon.com</email>
</author>
<published>2018-10-09T11:12:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9bd1f875c047a8a619a3e5233c1eb23eace02f31'/>
<id>urn:sha1:9bd1f875c047a8a619a3e5233c1eb23eace02f31</id>
<content type='text'>
pblk's read/write buffer currently takes a buffer and its size and uses
it to create the metadata around it to use it as a ring buffer. This
puts the responsibility of allocating/freeing ring buffer memory on the
ring buffer user. Instead, move it inside of the ring buffer helpers
(pblk-rb.c). This simplifies creation/destruction routines.

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>
<entry>
<title>lightnvm: pblk: encapsulate rb pointer operations</title>
<updated>2018-10-09T14:25:08+00:00</updated>
<author>
<name>Javier González</name>
<email>javier@javigon.com</email>
</author>
<published>2018-10-09T11:12:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=40b8657dcc0bbd4a293cac1acd4b0b01c0359416'/>
<id>urn:sha1:40b8657dcc0bbd4a293cac1acd4b0b01c0359416</id>
<content type='text'>
pblk's read/write buffer is always a power-of-2, thus wrapping up the
buffer can be done with a bit mask. Since this is an implementation
detail internal to the write buffer, make a helper that hides pointer
increment + wrap, and allows to transparently relax this assumption in
the future.

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>
<entry>
<title>lightnvm: pblk: remove unused function</title>
<updated>2018-10-09T14:25:08+00:00</updated>
<author>
<name>Javier González</name>
<email>javier@javigon.com</email>
</author>
<published>2018-10-09T11:12:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dde4aac20babee040875f76842a31b14b76dd369'/>
<id>urn:sha1:dde4aac20babee040875f76842a31b14b76dd369</id>
<content type='text'>
Removed unused function in pblk-rb.c

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>
