summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/pblk-write.c
diff options
context:
space:
mode:
authorHans Holmberg <hans.holmberg@cnexlabs.com>2018-06-01 16:41:06 +0200
committerJens Axboe <axboe@kernel.dk>2018-06-01 09:02:53 -0600
commit48b8d20895f8a489e1527e9bdc5e372808542fa3 (patch)
tree754ad9c349589759af22adad8286e7fa2b7095bc /drivers/lightnvm/pblk-write.c
parent6a3abf5beef6ae46381c1fb6976e6f313c40f0c1 (diff)
downloadblackbird-obmc-linux-48b8d20895f8a489e1527e9bdc5e372808542fa3.tar.gz
blackbird-obmc-linux-48b8d20895f8a489e1527e9bdc5e372808542fa3.zip
lightnvm: pblk: garbage collect lines with failed writes
Write failures should not happen under normal circumstances, so in order to bring the chunk back into a known state as soon as possible, evacuate all the valid data out of the line and let the fw judge if the block can be written to in the next reset cycle. Do this by introducing a new gc list for lines with failed writes, and ensure that the rate limiter allocates a small portion of the write bandwidth to get the job done. The lba list is saved in memory for use during gc as we cannot gurantee that the emeta data is readable if a write error occurred. Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com> Reviewed-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-write.c')
-rw-r--r--drivers/lightnvm/pblk-write.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c
index 7f9491bc64b5..f353e52941f5 100644
--- a/drivers/lightnvm/pblk-write.c
+++ b/drivers/lightnvm/pblk-write.c
@@ -136,6 +136,7 @@ static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa)
}
}
+ line->w_err_gc->has_write_err = 1;
spin_unlock(&line->lock);
}
@@ -279,6 +280,7 @@ static void pblk_end_io_write_meta(struct nvm_rq *rqd)
if (rqd->error) {
pblk_log_write_err(pblk, rqd);
pr_err("pblk: metadata I/O failed. Line %d\n", line->id);
+ line->w_err_gc->has_write_err = 1;
}
sync = atomic_add_return(rqd->nr_ppas, &emeta->sync);
OpenPOWER on IntegriCloud