diff options
author | Igor Konopko <igor.j.konopko@intel.com> | 2019-05-04 20:38:05 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-05-06 10:19:18 -0600 |
commit | f2e024570ef1a3d443875f6063321ee2e503ceb1 (patch) | |
tree | 38d0d4514b953abf1af92e4cb92acf325b0039e8 /drivers/lightnvm/pblk-gc.c | |
parent | 32ac0fa3afebb8b83e3f9189af1a481c0110fe51 (diff) | |
download | linux-f2e024570ef1a3d443875f6063321ee2e503ceb1.tar.gz linux-f2e024570ef1a3d443875f6063321ee2e503ceb1.tar.bz2 linux-f2e024570ef1a3d443875f6063321ee2e503ceb1.zip |
lightnvm: pblk: GC error handling
Currently when there is an IO error (or similar) on GC read path, pblk
still move the line, which was currently under GC process to free state.
Such a behaviour can lead to silent data mismatch issue.
With this patch, the line which was under GC process on which some IO
errors occurred, will be putted back to closed state (instead of free
state as it was without this patch) and the L2P mapping for such a
failed sectors will not be updated.
Then in case of any user IOs to such a failed sectors, pblk would be
able to return at least real IO error instead of stale data as it is
right now.
Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
Reviewed-by: Javier González <javier@javigon.com>
Reviewed-by: Hans Holmberg <hans.holmberg@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-gc.c')
-rw-r--r-- | drivers/lightnvm/pblk-gc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index e23b1923b773..63ee205b41c4 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -59,7 +59,7 @@ static void pblk_gc_writer_kick(struct pblk_gc *gc) wake_up_process(gc->gc_writer_ts); } -static void pblk_put_line_back(struct pblk *pblk, struct pblk_line *line) +void pblk_put_line_back(struct pblk *pblk, struct pblk_line *line) { struct pblk_line_mgmt *l_mg = &pblk->l_mg; struct list_head *move_list; @@ -98,8 +98,7 @@ static void pblk_gc_line_ws(struct work_struct *work) /* Read from GC victim block */ ret = pblk_submit_read_gc(pblk, gc_rq); if (ret) { - pblk_err(pblk, "failed GC read in line:%d (err:%d)\n", - line->id, ret); + line->w_err_gc->has_gc_err = 1; goto out; } |