summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2019-06-03 13:06:00 +0300
committerDavid Sterba <dsterba@suse.com>2019-06-07 14:52:05 +0200
commit8103d10b71610aa65a65d6611cd3ad3f3bd7beeb (patch)
tree11af4b39c6e5589054d62fbbd23a5ea231d62266 /lib
parent06989c799f04810f6876900d4760c0edda369cf7 (diff)
downloadlinux-8103d10b71610aa65a65d6611cd3ad3f3bd7beeb.tar.gz
linux-8103d10b71610aa65a65d6611cd3ad3f3bd7beeb.tar.bz2
linux-8103d10b71610aa65a65d6611cd3ad3f3bd7beeb.zip
btrfs: Always trim all unallocated space in btrfs_trim_free_extents
This patch removes support for range parameters of FITRIM ioctl when trimming unallocated space on devices. This is necessary since ranges passed from user space are generally interpreted as logical addresses, whereas btrfs_trim_free_extents used to interpret them as device physical extents. This could result in counter-intuitive behavior for users so it's best to remove that support altogether. Additionally, the existing range support had a bug where if an offset was passed to FITRIM which overflows u64 e.g. -1 (parsed as u64 18446744073709551615) then wrong data was fed into btrfs_issue_discard, which in turn leads to wrap-around when aligning the passed range and results in wrong regions being discarded which leads to data corruption. Fixes: c2d1b3aae336 ("btrfs: Honour FITRIM range constraints during free space trim") Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions