• Naohiro Aota's avatar
    btrfs: fix search key advancing condition · dd81d459
    Naohiro Aota authored
    The search key advancing condition used in copy_to_sk() is loose. It can
    advance the key even if it reaches sk->max_*: e.g. when the max key = (512,
    1024, -1) and the current key = (512, 1025, 10), it increments the
    offset by 1, continues hopeless search from (512, 1025, 11). This issue
    make ioctl() to take unexpectedly long time scanning all the leaf a blocks
    one by one.
    
    This commit fix the problem using standard way of key comparison:
    btrfs_comp_cpu_keys()
    Signed-off-by: default avatarNaohiro Aota <naota@elisp.net>
    Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarChris Mason <clm@fb.com>
    dd81d459
ioctl.c 133 KB