From: Igor Konopko Date: Sat, 4 May 2019 18:37:46 +0000 (+0200) Subject: lightnvm: pblk: line reference fix in GC X-Git-Tag: v5.15~6320^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e5434eecefce78b40526e44de3d4559aaaf1b90;p=platform%2Fkernel%2Flinux-starfive.git lightnvm: pblk: line reference fix in GC Fixes the GC error case when moving a line back to closed state while releasing additional references. Signed-off-by: Igor Konopko Reviewed-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index 26a52ea..901e499 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -290,8 +290,11 @@ fail_free_invalid_bitmap: fail_free_ws: kfree(line_ws); + /* Line goes back to closed state, so we cannot release additional + * reference for line, since we do that only when we want to do + * gc to free line state transition. + */ pblk_put_line_back(pblk, line); - kref_put(&line->ref, pblk_line_put); atomic_dec(&gc->read_inflight_gc); pblk_err(pblk, "failed to GC line %d\n", line->id);