btrfs: add regression test for compress-force mount options
authorQu Wenruo <wqu@suse.com>
Thu, 25 Nov 2021 06:05:29 +0000 (14:05 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 28 Nov 2021 16:35:52 +0000 (00:35 +0800)
commit2050356437e3576673ec5ead79ad72eb619f0d72
tree0d943ee494a1b8735b432a0c00d9c6bfccbdc9c6
parentb310fc20be26723c4002e9aa5cb82b7d3c56c83f
btrfs: add regression test for compress-force mount options

Since kernel commit d4088803f511 ("btrfs: subpage: make lzo_compress_pages()
compatible"), lzo compression no longer respects the max compressed page
limit, and can cause kernel crash.

The upstream fix is 6f019c0e0193 ("btrfs: fix a out-of-bound access in
copy_compressed_data_to_page()").

This patch will add such regression test for all possible compress-force
mount options, including lzo, zstd and zlib.

And since we're here, also make sure the content of the file matches
after a mount cycle.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/251 [new file with mode: 0755]
tests/btrfs/251.out [new file with mode: 0644]