• Liu Bo's avatar
    Btrfs: add parent_transid parameter to veirfy_level_key · ff76a864
    Liu Bo authored
    As verify_level_key() is checked after verify_parent_transid(), i.e.
    
    if (verify_parent_transid())
       ret = -EIO;
    else if (verify_level_key())
       ret = -EUCLEAN;
    
    if parent_transid is 0, verify_parent_transid() skips verifying
    parent_transid and considers eb as valid, and if verify_level_key()
    reports something wrong, we're not going to know if it's caused by
    corrupted metadata or non-checkecd eb (e.g. stale eb).
    
    The stale eb can be from an outdated raid1 mirror after a degraded
    mount, see eg "btrfs: fix reading stale metadata blocks after degraded
    raid1 mounts" (02a3307a) for more details.
    
    @parent_transid is able to tell whether the eb's generation has been
    verified by the caller.
    Signed-off-by: default avatarLiu Bo <bo.liu@linux.alibaba.com>
    Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    ff76a864
disk-io.c 125 KB