]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: fix race on sysfs line state
authorJavier González <javier@javigon.com>
Tue, 9 Oct 2018 11:12:07 +0000 (13:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 9 Oct 2018 14:25:08 +0000 (08:25 -0600)
commit24fa670a6ab7b3157c10694515b6e4d32a95e50c
treedb6d14e7d352ee04ff6f7ec6ea20a34fdf990d8d
parentf0aaee73aa701eb1d0e522912f49654742f65fcf
lightnvm: pblk: fix race on sysfs line state

pblk exposes a sysfs interface that represents its internal state. Part
of this state is the map bitmap for the current open line, which should
be protected by the line lock to avoid a race when freeing the line
metadata. Currently, it is not.

This patch makes sure that the line state is consistent and NULL
bitmap pointers are not dereferenced.

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-core.c
drivers/lightnvm/pblk-sysfs.c