]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix extent buffer bitmap tests on big-endian systems
authorOmar Sandoval <osandov@fb.com>
Fri, 23 Sep 2016 00:24:23 +0000 (17:24 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Oct 2016 16:52:14 +0000 (18:52 +0200)
commit8c932091dc715050688dd47ee4914478c16f5842
tree1bc84d1906d111f59e69721e1268bdf722364604
parentd2695900474520d0b691a37808657599c0979471
Btrfs: fix extent buffer bitmap tests on big-endian systems

The in-memory bitmap code manipulates words and is therefore sensitive
to endianness, while the extent buffer bitmap code addresses bytes and
is byte-order agnostic. Because the byte addressing of the extent buffer
bitmaps is equivalent to a little-endian in-memory bitmap, the extent
buffer bitmap tests fail on big-endian systems.

74f0cf277357 ("Btrfs: self-tests: Fix extent buffer bitmap test fail on
BE system") worked around another endianness bug in the tests but missed
this one because 02229b0a0727 ("Btrfs: self-tests: Execute page
straddling test only when nodesize < PAGE_SIZE") disables this part of
the test on ppc64. That change lost the original meaning of the test,
however. We really want to test that an equivalent series of operations
using the in-memory bitmap API and the extent buffer bitmap API produces
equivalent results.

To fix this, don't use memcmp_extent_buffer() or write_extent_buffer();
do everything bit-by-bit.

Reported-by: Anatoly Pugachev <matorola@gmail.com>
Tested-by: Anatoly Pugachev <matorola@gmail.com>
Tested-by: Feifei Xu <xufeifei@linux.vnet.ibm.com>
Tested-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tests/extent-io-tests.c