fstests: btrfs, verify fitrim does not discard reserved device area
authorFilipe Manana <fdmanana@suse.com>
Mon, 11 Jan 2016 04:12:20 +0000 (15:12 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 11 Jan 2016 04:12:20 +0000 (15:12 +1100)
commit315e6b4ed4acaf694ca20f9d9a0068e12b945fc6
treebf646b5dd00105cd5bdc7bbd007e49b168ca09e4
parent05754e673fafd5473d63c214e362462d10bdb7a7
fstests: btrfs, verify fitrim does not discard reserved device area

Verify that when a fitrim operation is made against a btrfs filesystem,
the ranges [0, 64Kb[ and [68Kb, 1Mb[ of the device are not discarded,
they remain with the content they had before the fitrim operation. These
regions of the device are reserved for a boot loader to use at its will.

In the 4.3 linux kernel we got a regression that allowed a fitrim
operation to discard these reserved ranges of the device, resulting in
the filesystem becoming unbootable after a fitrim. The issue is fixed
by the following patch (targeted for 4.5 and 4.3/4.4 stable releases):

 "Btrfs: fix fitrim discarding device area reserved for boot loader's use"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/btrfs/116 [new file with mode: 0755]
tests/btrfs/116.out [new file with mode: 0644]
tests/btrfs/group