Liu Bo 2cac13e41b Btrfs: fix trim 0 bytes after a device delete
A user reported a bug of btrfs's trim, that is we will trim 0 bytes
after a device delete.

The reproducer:

$ mkfs.btrfs disk1
$ mkfs.btrfs disk2
$ mount disk1 /mnt
$ fstrim -v /mnt
$ btrfs device add disk2 /mnt
$ btrfs device del disk1 /mnt
$ fstrim -v /mnt

This is because after we delete the device, the block group may start from
a non-zero place, which will confuse trim to discard nothing.

Reported-by: Lutz Euler <lutz.euler@freenet.de>
Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
2012-02-15 16:40:23 +01:00
..
2012-01-04 16:26:38 +01:00
2011-12-22 16:22:27 +01:00
2012-01-16 15:29:43 -05:00
2011-07-26 16:49:47 -07:00
2012-01-16 15:29:43 -05:00
2012-01-26 15:01:12 -05:00
2012-01-16 22:04:49 +02:00
2011-10-20 18:10:50 +02:00
2011-06-17 14:54:18 -04:00
2012-01-16 15:29:43 -05:00
2011-05-28 07:00:39 -04:00
2012-01-16 15:38:24 -05:00