linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <n.borisov.lkml@gmail.com>
To: "Marek Behún" <marek.behun@nic.cz>, linux-btrfs@vger.kernel.org
Subject: Re: Decompression success/failure dependent on PAGE_SIZE?
Date: Tue, 29 Aug 2017 20:44:03 +0300	[thread overview]
Message-ID: <bfe3e720-00e5-1a5a-7b08-c2cd32b62a08@gmail.com> (raw)
In-Reply-To: <20170829184342.2f6ec0b0@dellmb.labs.office.nic.cz>



On 29.08.2017 19: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?

Please have a look in btrfs_check_super_valid(), which is being called
from open_ctree, which in turn is called when a filesystem is mounted.

Currently btrfs supports a single blocksize value - PAGE_SIZE, also it's
forbidden to mount a filesystem on systems with different page_sizes.
When the sub-page blocksizes patch is merged this might be have to be
taken into consideration but certainly not at present times.

> 
> Thank you.
> 
> Marek
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      parent reply	other threads:[~2017-08-29 17:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 16:43 Decompression success/failure dependent on PAGE_SIZE? Marek Behún
2017-08-29 17:13 ` Austin S. Hemmelgarn
2017-08-29 17:44 ` Nikolay Borisov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bfe3e720-00e5-1a5a-7b08-c2cd32b62a08@gmail.com \
    --to=n.borisov.lkml@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=marek.behun@nic.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).