diff options
author | Hans Holmberg <hans.holmberg@cnexlabs.com> | 2018-10-09 07:11:59 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-10-09 10:25:07 -0400 |
commit | bf82fa2f584f1c6e12df8c04fca715d53e7f32d5 (patch) | |
tree | 9b622c57cfba014d8e10c6aa4070b68fb67142ff /drivers/lightnvm/pblk-write.c | |
parent | 1864de94ec9d6e1ae4d481212847374df9b1be41 (diff) |
lightnvm: pblk: fix mapping issue on failed writes
On 1.2-devices, the mapping-out of remaning sectors in the
failed-write's block can result in an infinite loop,
stalling the write pipeline, fix this.
Fixes: 6a3abf5beef6 ("lightnvm: pblk: rework write error recovery path")
Signed-off-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-write.c')
-rw-r--r-- | drivers/lightnvm/pblk-write.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c index 61fe22ccc7a1..9554febee480 100644 --- a/drivers/lightnvm/pblk-write.c +++ b/drivers/lightnvm/pblk-write.c | |||
@@ -106,8 +106,6 @@ retry: | |||
106 | /* Map remaining sectors in chunk, starting from ppa */ | 106 | /* Map remaining sectors in chunk, starting from ppa */ |
107 | static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa) | 107 | static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa) |
108 | { | 108 | { |
109 | struct nvm_tgt_dev *dev = pblk->dev; | ||
110 | struct nvm_geo *geo = &dev->geo; | ||
111 | struct pblk_line *line; | 109 | struct pblk_line *line; |
112 | struct ppa_addr map_ppa = *ppa; | 110 | struct ppa_addr map_ppa = *ppa; |
113 | u64 paddr; | 111 | u64 paddr; |
@@ -125,15 +123,7 @@ static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa) | |||
125 | if (!test_and_set_bit(paddr, line->invalid_bitmap)) | 123 | if (!test_and_set_bit(paddr, line->invalid_bitmap)) |
126 | le32_add_cpu(line->vsc, -1); | 124 | le32_add_cpu(line->vsc, -1); |
127 | 125 | ||
128 | if (geo->version == NVM_OCSSD_SPEC_12) { | 126 | done = nvm_next_ppa_in_chk(pblk->dev, &map_ppa); |
129 | map_ppa.ppa++; | ||
130 | if (map_ppa.g.pg == geo->num_pg) | ||
131 | done = 1; | ||
132 | } else { | ||
133 | map_ppa.m.sec++; | ||
134 | if (map_ppa.m.sec == geo->clba) | ||
135 | done = 1; | ||
136 | } | ||
137 | } | 127 | } |
138 | 128 | ||
139 | line->w_err_gc->has_write_err = 1; | 129 | line->w_err_gc->has_write_err = 1; |