lightnvm: pblk: fail gracefully on line alloc. failure

In the event of a line failing to allocate, fail gracefully and stop the
pipeline to avoid more write failing in the same place.

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>
This commit is contained in:
Javier González
2018-06-01 15:04:15 +02:00
committed by Jens Axboe
parent 84e92c131a
commit 2deeefc02d
2 changed files with 29 additions and 9 deletions

View File

@@ -1047,6 +1047,11 @@ static int pblk_lines_init(struct pblk *pblk)
nr_free_chks += pblk_setup_line_meta(pblk, line, chunk_meta, i);
}
if (!nr_free_chks) {
pr_err("pblk: too many bad blocks prevent for sane instance\n");
return -EINTR;
}
pblk_set_provision(pblk, nr_free_chks);
kfree(chunk_meta);