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:

committed by
Jens Axboe

parent
84e92c131a
commit
2deeefc02d
@@ -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);
|
||||
|
Reference in New Issue
Block a user