• Hans Holmberg's avatar
    lightnvm: pblk: check data lines version on recovery · d0ab0b1a
    Hans Holmberg authored
    As a preparation for future bumps of data line persistent storage
    versions, we need to start checking the emeta line version during
    recovery. Also slit up the current emeta/smeta version into two
    bytes (major,minor).
    
    Recovering lines with the same major number as the current pblk data
    line version must succeed. This means that any changes in the
    persistent format must be:
    
     (1) Backward compatible: if we switch back to and older
         kernel, recovery of lines stored with major == current_major
         and minor > current_minor must succeed.
    
     (2) Forward compatible: switching to a newer kernel,
         recovery of lines stored with major=current_major and
         minor < minor must handle the data format differences
         gracefully(i.e. initialize new data structures to default values).
    
    If we detect lines that have a different major number than
    the current we must abort recovery. The user must manually
    migrate the data in this case.
    
    Previously the version stored in the emeta header was copied
    from smeta, which has version 1, so we need to set the minor
    version to 1.
    Signed-off-by: default avatarHans Holmberg <hans.holmberg@cnexlabs.com>
    Signed-off-by: default avatarJavier González <javier@cnexlabs.com>
    Signed-off-by: default avatarMatias Bjørling <mb@lightnvm.io>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    d0ab0b1a
pblk.h 36.3 KB