This is a note to let you know that I've just added the patch titled
lightnvm: pblk: protect line bitmap while submitting meta io
to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: lightnvm-pblk-protect-line-bitmap-while-submitting-meta-io.patch and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Mon Dec 18 13:29:00 CET 2017
From: Rakesh Pandit rakesh@tuxera.com Date: Fri, 13 Oct 2017 14:45:56 +0200 Subject: lightnvm: pblk: protect line bitmap while submitting meta io
From: Rakesh Pandit rakesh@tuxera.com
[ Upstream commit e57903fd972a398b7140d0bc055714e13a0e58c5 ]
It seems pblk_dealloc_page would race against pblk_alloc_pages for line bitmap for sector allocation.The chances are very low but might as well protect the bitmap properly.
Signed-off-by: Rakesh Pandit rakesh@tuxera.com Reviewed-by: Javier González javier@cnexlabs.com Signed-off-by: Matias Bjørling m@bjorling.me Signed-off-by: Jens Axboe axboe@kernel.dk Signed-off-by: Sasha Levin alexander.levin@verizon.com Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/lightnvm/pblk-core.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/drivers/lightnvm/pblk-core.c +++ b/drivers/lightnvm/pblk-core.c @@ -486,12 +486,14 @@ void pblk_dealloc_page(struct pblk *pblk u64 addr; int i;
+ spin_lock(&line->lock); addr = find_next_zero_bit(line->map_bitmap, pblk->lm.sec_per_line, line->cur_sec); line->cur_sec = addr - nr_secs;
for (i = 0; i < nr_secs; i++, line->cur_sec--) WARN_ON(!test_and_clear_bit(line->cur_sec, line->map_bitmap)); + spin_unlock(&line->lock); }
u64 __pblk_alloc_page(struct pblk *pblk, struct pblk_line *line, int nr_secs)
Patches currently in stable-queue which might be from rakesh@tuxera.com are
queue-4.14/lightnvm-pblk-protect-line-bitmap-while-submitting-meta-io.patch queue-4.14/lightnvm-pblk-fix-changing-gc-group-list-for-a-line.patch