From: Marcin Dziegielewski Date: Sat, 4 May 2019 18:37:57 +0000 (+0200) Subject: lightnvm: pblk: set propper line as data_line after gc X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4bbae699226ea72a91a665f489c0d85fb48885d1;p=linux.git lightnvm: pblk: set propper line as data_line after gc In current implementation of l2p recovery, when we are after gc and we have open line, we are not setting current data line properly (we set last line from the device instead of last line ordered by seq_nr) and in consequence, kernel panic and data corruption. Signed-off-by: Marcin Dziegielewski Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c index 83b467b5edc77..017874e03253e 100644 --- a/drivers/lightnvm/pblk-recovery.c +++ b/drivers/lightnvm/pblk-recovery.c @@ -844,6 +844,7 @@ next: spin_unlock(&l_mg->free_lock); } else { spin_lock(&l_mg->free_lock); + l_mg->data_line = data_line; /* Allocate next line for preparation */ l_mg->data_next = pblk_line_get(pblk); if (l_mg->data_next) {