linux-stable/drivers/lightnvm
Javier González 013b559adf lightnvm: pblk: fix race condition on metadata I/O
[ Upstream commit d8adaa3b86 ]

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: dd2a434373 ("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>
2018-11-13 11:08:21 -08:00
..
core.c lightnvm: pass flag on graceful teardown to targets 2018-06-01 07:43:53 -06:00
Kconfig lightnvm: move NVM_DEBUG to pblk 2018-07-13 08:14:31 -06:00
Makefile lightnvm: remove rrpc 2018-01-05 08:50:12 -07:00
pblk-cache.c block: Add and use op_stat_group() for indexing disk_stat fields. 2018-07-18 08:44:20 -06:00
pblk-core.c lightnvm: pblk: fix race on sysfs line state 2018-11-13 11:08:21 -08:00
pblk-gc.c lightnvm: pblk: expose generic disk name on pr_* msgs 2018-07-13 08:14:43 -06:00
pblk-init.c lightnvm: pblk: assume that chunks are closed on 1.2 devices 2018-07-13 08:14:49 -06:00
pblk-map.c lightnvm: pblk: fail gracefully on line alloc. failure 2018-06-01 07:43:53 -06:00
pblk-rb.c lightnvm: pblk: expose generic disk name on pr_* msgs 2018-07-13 08:14:43 -06:00
pblk-read.c block: Add and use op_stat_group() for indexing disk_stat fields. 2018-07-18 08:44:20 -06:00
pblk-recovery.c lightnvm: pblk: fix two sleep-in-atomic-context bugs 2018-11-13 11:08:21 -08:00
pblk-rl.c lightnvm: pblk: garbage collect lines with failed writes 2018-06-01 09:02:53 -06:00
pblk-sysfs.c lightnvm: pblk: fix race on sysfs line state 2018-11-13 11:08:21 -08:00
pblk-write.c lightnvm: pblk: fix race condition on metadata I/O 2018-11-13 11:08:21 -08:00
pblk.h lightnvm: pblk: add asynchronous partial read 2018-07-13 08:14:47 -06:00