• Anand Jain's avatar
    btrfs: consolidate uuid comparisons in btrfs_validate_super · 25984a5a
    Anand Jain authored
    There are three ways the fsid is validated in btrfs_validate_super():
    
    - verify that super_copy::fsid is the same as fs_devices::fsid
    
    - if the metadata_uuid flag is set, verify if super_copy::metadata_uuid
      and fs_devices::metadata_uuid are the same.
    
    - a few lines below, often missed out, verify if dev_item::fsid is the
      same as fs_devices::metadata_uuid.
    
    The function btrfs_validate_super() contains multiple if-statements with
    memcmp() to check UUIDs. This patch consolidates them into a single
    location.
    Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    25984a5a
disk-io.c 139 KB