]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: fix race condition on metadata I/O
authorJavier González <javier@javigon.com>
Tue, 9 Oct 2018 11:11:35 +0000 (13:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Oct 2018 14:25:06 +0000 (08:25 -0600)
commit4721d42b619ca07fd1f152b0a7b8b0fb46fa9e44
tree57dc2d2307041907fd8b116876e668565f400b25
parentd516dcf826e2efd71398b8d73716d73f1dc5bc60
lightnvm: pblk: fix race condition on metadata I/O

In pblk, when a new line is allocated, metadata for the previously
written line is scheduled. This is done through a fixed memory region
that is shared through time and contexts across different lines and
therefore protected by a lock. Unfortunately, this lock is not properly
covering all the metadata used for sharing this memory regions,
resulting in a race condition.

This patch fixes this race condition by protecting this metadata
properly.

Fixes: 2a2166dd166b ("lightnvm: pblk: sched. metadata on write thread")
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-write.c