All of lore.kernel.org
 help / color / mirror / Atom feed
From: james harvey <jamespharvey20@gmail.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: inode: Don't compress if NODATASUM or NODATACOW set
Date: Mon, 14 May 2018 18:29:22 -0400	[thread overview]
Message-ID: <CA+X5Wn4tv=h5xt2D5wMb7mFm3SuWG0efahuyFwdTGgTkeYhnmA@mail.gmail.com> (raw)
In-Reply-To: <20180514165205.GP6649@twin.jikos.cz>

On Mon, May 14, 2018 at 12:52 PM, David Sterba <dsterba@suse.cz> wrote:
> On Mon, May 14, 2018 at 03:02:10PM +0800, Qu Wenruo wrote:
>> As btrfs(5) specified:
>>
>>       Note
>>       If nodatacow or nodatasum are enabled, compression is disabled.
>>
>> If NODATASUM or NODATACOW set, we should not compress the extent.
>>
>> And in fact, we have bug report about corrupted compressed extent
>> leading to memory corruption in mail list.
>
> Link please.

https://bugzilla.kernel.org/show_bug.cgi?id=199707
&
https://www.spinics.net/lists/linux-btrfs/msg77971.html

>> Although it's mostly buggy lzo implementation causing the problem, btrfs
>> still needs to be fixed to meet the specification.
>
> That's very vague, what's the LZO bug? If the input is garbage and lzo
> decompression cannot decompress it, it's not a lzo bug.

The bug is the kernel doesn't just give an I/O error.  It totally
crashes the system.  Even a regular user cat'ing an invalid
btrfs-lzo-compressed file will take the system down.  Qu's current
theory which I agree with is it causes some kind of random kernel
memory corruption.  The crashes sometimes include "BTRFS: decompress
failed" at the start, but give backtraces for other things than btrfs
lzo code.

  parent reply	other threads:[~2018-05-14 22:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14  7:02 [PATCH] btrfs: inode: Don't compress if NODATASUM or NODATACOW set Qu Wenruo
2018-05-14  8:10 ` Nikolay Borisov
2018-05-14  8:20   ` Roman Mamedov
2018-05-14  8:36     ` Nikolay Borisov
2018-05-14  9:31       ` james harvey
2018-05-14  9:39       ` Roman Mamedov
2018-05-14  9:46         ` Nikolay Borisov
2018-05-14 16:49           ` David Sterba
2018-05-14  9:30     ` james harvey
2018-05-14 10:35       ` Qu Wenruo
2018-05-14 22:24         ` james harvey
2018-05-15  0:15         ` james harvey
2018-05-14  8:24   ` Qu Wenruo
2018-05-14 16:52 ` David Sterba
2018-05-14 20:46   ` Timofey Titovets
2018-05-15 18:18     ` David Sterba
2018-05-14 22:29   ` james harvey [this message]
2018-05-15  1:35   ` 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='CA+X5Wn4tv=h5xt2D5wMb7mFm3SuWG0efahuyFwdTGgTkeYhnmA@mail.gmail.com' \
    --to=jamespharvey20@gmail.com \
    --cc=dsterba@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.