• D
    Revert "btrfs: Honour FITRIM range constraints during free space trim" · 9164f29e
    David Sterba 提交于
    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: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    9164f29e
extent-tree.c 300.2 KB