From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Cc: jamespharvey20@gmail.com
Subject: Re: [PATCH 2/4] btrfs: lzo: Add comment about the how btrfs records its lzo compressed data
Date: Thu, 17 May 2018 10:48:36 +0300 [thread overview]
Message-ID: <a8146d5e-0558-e9f0-bf98-c51c9736691a@suse.com> (raw)
In-Reply-To: <20180517062753.25973-3-wqu@suse.com>
On 17.05.2018 09:27, Qu Wenruo wrote:
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Overall it looks good and useful just a couple of nits below.
> ---
> fs/btrfs/lzo.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
> index 0667ea07f766..3d2ae4c08876 100644
> --- a/fs/btrfs/lzo.c
> +++ b/fs/btrfs/lzo.c
> @@ -17,6 +17,29 @@
>
> #define LZO_LEN 4
>
> +/*
> + * Btrfs LZO compression format
> + *
> + * Regular LZO compressed data extent is consist of:
nit: s/is consist/consists
> + * 1. Header
> + * Fixed size. LZO_LEN (4) bytes long, LE16.
> + * Records the total size (*includes* the header) of real compressed data.
> + *
> + * 2. Segment(s)
> + * Variable size. Includes one segment header, and then data payload.
> + * One btrfs compressed data can have one or more segments.
So "one btrfs compressed data" should really mean "one btrfs compressed
extent" I guess?
> + *
> + * 2.1 Segment header
> + * Fixed size. LZO_LEN (4) bytes long, LE16.
> + * Records the total size of the segment (*excludes* the header).
> + *
> + * 2.2 Data Payload
> + * Variable size. Size up limit should be lzo1x_worst_compress(PAGE_SIZE).
> + *
> + * While for inlined LZO compressed data extent, it doesn't have Header, just
> + * one Segment.
> + */
> +
> struct workspace {
> void *mem;
> void *buf; /* where decompressed data goes */
>
next prev parent reply other threads:[~2018-05-17 7:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 6:27 [PATCH 0/4] btrfs: lzo: Harden decompression callers to avoid Qu Wenruo
2018-05-17 6:27 ` [PATCH 1/4] btrfs: compression: Add linux/sizes.h for compression.h Qu Wenruo
2018-05-17 7:49 ` Nikolay Borisov
2018-05-17 6:27 ` [PATCH 2/4] btrfs: lzo: Add comment about the how btrfs records its lzo compressed data Qu Wenruo
2018-05-17 7:48 ` Nikolay Borisov [this message]
2018-05-17 8:04 ` Qu Wenruo
2018-05-17 6:27 ` [PATCH 3/4] btrfs: lzo: Add header length check to avoid slab out of bounds access Qu Wenruo
2018-05-17 8:14 ` Nikolay Borisov
2018-05-17 8:19 ` Qu Wenruo
2018-05-17 9:05 ` Qu Wenruo
2018-05-22 14:14 ` David Sterba
2018-05-17 6:27 ` [PATCH 4/4] btrfs: lzo: Hardern inline lzo compressed extent decompression Qu Wenruo
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=a8146d5e-0558-e9f0-bf98-c51c9736691a@suse.com \
--to=nborisov@suse.com \
--cc=jamespharvey20@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/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