• Y
    Btrfs: check size of inode backref before adding hardlink · a5719521
    Yan, Zheng 提交于
    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: NYan Zheng <zheng.yan@oracle.com>
    Signed-off-by: NChris Mason <chris.mason@oracle.com>
    a5719521
inode.c 150.9 KB