• Chao Yu's avatar
    f2fs: compress: do sanity check on cluster · bbe1da7e
    Chao Yu authored
    This patch adds f2fs_sanity_check_cluster() to support doing
    sanity check on cluster of compressed file, it will be triggered
    from below two paths:
    
    - __f2fs_cluster_blocks()
    - f2fs_map_blocks(F2FS_GET_BLOCK_FIEMAP)
    
    And it can detect below three kind of cluster insanity status.
    
    C: COMPRESS_ADDR
    N: NULL_ADDR or NEW_ADDR
    V: valid blkaddr
    *: any value
    
    1. [*|C|*|*]
    2. [C|*|C|*]
    3. [C|N|N|V]
    Signed-off-by: default avatarChao Yu <chao@kernel.org>
    [Nathan Chancellor: fix missing inline warning]
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    bbe1da7e
compress.c 45.6 KB