• Hans Holmberg's avatar
    lightnvm: pblk: consider bad sectors in emeta during recovery · 75610cd9
    Hans Holmberg authored
    When recovering lines we need to consider that bad blocks in a line
    affect the emeta area size.
    
    Previously it was assumed that the emeta area would grow by the
    number of sectors per page * number of bad blocks in the line.
    
    This assumption is not correct - the number of "extra" pages that are
    consumed could be both smaller (depending on emeta size) and bigger
    (depending on the placement of the bad blocks).
    
    Fix this by calculating the emeta start by iterating backwards
    through the line, skipping ppas that map to bad blocks.
    
    Also fix the data types used for ppa indices/counts in
    pblk_recov_l2p_from_emeta - we should use u64.
    Signed-off-by: default avatarHans Holmberg <hans.holmberg@cnexlabs.com>
    Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    75610cd9
pblk-recovery.c 25.6 KB