Skip to content
  • Yan, Zheng's avatar
    Btrfs: check size of inode backref before adding hardlink · a5719521
    Yan, Zheng authored
    
    
    For every hardlink in btrfs, there is a corresponding inode back
    reference. All inode back references for hardlinks in a given
    directory are stored in single b-tree item. The size of b-tree item
    is limited by the size of b-tree leaf, so we can only create limited
    number of hardlinks to a given file in a directory.
    
    The original code lacks of the check, it oops if the number of
    hardlinks goes over the limit. This patch fixes the issue by adding
    check to btrfs_link and btrfs_rename.
    
    Signed-off-by: default avatarYan Zheng <zheng.yan@oracle.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    a5719521