Skip to content
Commit f4c697e6 authored by Lukas Czerner's avatar Lukas Czerner Committed by David Sterba
Browse files

btrfs: return EINVAL if start > total_bytes in fitrim ioctl



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>
parent 008873ea
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment