]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: pblk: fix erase counters on error fail
authorJavier González <jg@lightnvm.io>
Fri, 21 Apr 2017 23:32:49 +0000 (01:32 +0200)
committerJens Axboe <axboe@fb.com>
Sun, 23 Apr 2017 22:57:52 +0000 (16:57 -0600)
commit9bb5d3bccf8ed07f3d118ed1ddb6267dac78c70a
tree92183bdbb213a0b9604bbb387bc4749c091919cc
parent3b230bbf0966b192fb273edae84ef4c4a8536e44
lightnvm: pblk: fix erase counters on error fail

When block erases fail, these blocks are marked bad. The number of valid
blocks in the line was not updated, which could cause an infinite loop
on the erase path.

Fix this atomic counter and, in order to avoid taking an irq lock on the
interrupt context, make the erase counters atomic too.

Also, in the case that a significant number of blocks become bad in a
line, the result is the double shared metadata buffer (emeta) to stop
the pipeline until all metadata is flushed to the media. Increase the
number of metadata lines from 2 to 4 to avoid this case.

Fixes: 666397e18deb "lightnvm: physical block device (pblk) target"
Signed-off-by: Javier González <javier@cnexlabs.com>
Reviewed-by: Matias Bjørling <matias@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/pblk-core.c
drivers/lightnvm/pblk-gc.c
drivers/lightnvm/pblk-init.c
drivers/lightnvm/pblk-map.c
drivers/lightnvm/pblk-rl.c
drivers/lightnvm/pblk-write.c
drivers/lightnvm/pblk.h