lightnvm: pblk: fix update line wp in OOB recovery
authorIgor Konopko <igor.j.konopko@intel.com>
Sat, 4 May 2019 18:38:01 +0000 (20:38 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 May 2019 16:19:18 +0000 (10:19 -0600)
commit2b0ae81e2a6f2114a68bdcc410bd1d72bacc97ad
tree627fc73fa7317b79443e549a6ddf5de9b6ebe2c2
parent74a37fbb5c8deca5f19fe072ce2dec3a0900f81f
lightnvm: pblk: fix update line wp in OOB recovery

In case of OOB recovery, we can hit the scenario when all the data in
line were written and some part of emeta was written too. In such
a case pblk_update_line_wp() function will call pblk_alloc_page()
function which will case to set left_msecs to value below zero
(since this field does not track emeta region) and thus will lead to
multiple kernel warnings. This patch fixes that issue.

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-recovery.c