]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lightnvm: pblk: fix race condition on metadata I/O
authorJavier González <javier@cnexlabs.com>
Tue, 9 Oct 2018 11:11:35 +0000 (13:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:12:20 +0000 (11:12 -0800)
commitfeea46d8f5b046d9d18116bb180b8b41f7090960
tree3e9b1f85b0c3b0261a83fc6d78095a86ec80b7e5
parentafa8688bd3bf30e374e0134d44df542d6c51d298
lightnvm: pblk: fix race condition on metadata I/O

[ Upstream commit d8adaa3b86324c6186d0adf74bc256bdacfffdb6 ]

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: dd2a43437337 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/lightnvm/pblk-write.c