OSDN Git Service

Revert "btrfs: Honour FITRIM range constraints during free space trim"
authorDavid Sterba <dsterba@suse.com>
Wed, 29 May 2019 17:25:44 +0000 (19:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:46:05 +0000 (06:46 -0700)
commit06a67c0f4abb34784cc296fc3d242fcd03459ca2
tree9ac4663b2827e64d09bbaf9d47058a0c27b2c2d6
parent7c2bcb3cca0339b73f6e1883c14f1166f233c8d9
Revert "btrfs: Honour FITRIM range constraints during free space trim"

This reverts commit 8b13bb911f0c0c77d41e5ddc41ad3c127c356b8a.

There is currently no corresponding patch in master due to additional
changes that would be significantly different from plain revert in the
respective stable branch.

The range argument was not handled correctly and could cause trim to
overlap allocated areas or reach beyond the end of the device. The
address space that fitrim normally operates on is in logical
coordinates, while the discards are done on the physical device extents.
This distinction cannot be made with the current ioctl interface and
caused the confusion.

The bug depends on the layout of block groups and does not always
happen. The whole-fs trim (run by default by the fstrim tool) is not
affected.

Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/extent-tree.c