]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: guarantee line integrity on reads
authorJavier González <javier@cnexlabs.com>
Fri, 13 Oct 2017 12:46:23 +0000 (14:46 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Oct 2017 14:34:57 +0000 (08:34 -0600)
commitaaf8da6eb54019a65f7424cc72a58f97f200cb51
tree01cbfeca78132835d73f56f1a42c5aeb0731b287
parente3835b0cf0b084d8e25885c6ae8fd36b90d897b8
lightnvm: pblk: guarantee line integrity on reads

When a line is recycled during garbage collection, reads can still be
issued to the line. If the line is freed in the middle of this process,
data corruption might occur.

This patch guarantees that lines are not freed in the middle of reads
that target them (lines). Specifically, we use the existing line
reference to decide when a line is eligible for being freed after the
recycle process.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c
drivers/lightnvm/pblk-init.c
drivers/lightnvm/pblk-read.c
drivers/lightnvm/pblk.h