• Javier González's avatar
    lightnvm: pblk: fix erase counters on error fail · a44f53fa
    Javier González authored
    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: a4bd217b "lightnvm: physical block device (pblk) target"
    Signed-off-by: default avatarJavier González <javier@cnexlabs.com>
    Reviewed-by: default avatarMatias Bjørling <matias@cnexlabs.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    a44f53fa
pblk-map.c 4.24 KB