• Lukas Czerner's avatar
    btrfs: return EINVAL if start > total_bytes in fitrim ioctl · f4c697e6
    Lukas Czerner authored
    We should retirn EINVAL if the start is beyond the end of the file
    system in the btrfs_ioctl_fitrim(). Fix that by adding the appropriate
    check for it.
    
    Also in the btrfs_trim_fs() it is possible that len+start might overflow
    if big values are passed. Fix it by decrementing the len so that start+len
    is equal to the file system size in the worst case.
    Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
    f4c697e6
ioctl.c 71.2 KB