OSDN Git Service

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)
commit7bd4d370db6090004a06deb526f0f01fa99a3f9f
tree01cbfeca78132835d73f56f1a42c5aeb0731b287
parenta4809fee4e774fdf3296cc69c22ce6e6acef36b2
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