On 2017-08-29 12:43, Marek BehĂșn wrote:
Hello,
so I've been studying the linux btrfs code and have come across this:
in inode.c function uncompress_inline the max_size size variable is set
to min(max_size, PAGE_SIZE) and only max_size of output data are
decompressed.
The code for compression (in lzo.c for example) uses PAGE_SIZEd chunks
to compress an inline extent.
If I understand it correctly, then if the filesystem is created and used
on a computer with PAGE_SIZE for example 16KB, and an extent of size
16KB is compressed to (for example 9KB) and stored as inline extent,
and then the filesystem is mounted on a computer with PAGE_SIZE = 4KB,
reading the extent will result in a failure or incomplete read.
Is this a bug, or is this behaviour a feature?
It's absolutely not a feature. I've not actually seen this issue
mentioned anywhere myself, but I'm willing to bet that the consensus
among developers will be that its an unintentional limitation of the
current design. There are in fact issues when trying to use a
filesystem with a block size smaller than PAGE_SIZE as well, so the
general consensus is to not mix filesystems from different architectures
unless you know the page size matches.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html