linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stéphane Lesimple" <stephane_btrfs@lesimple.fr>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/2] Btrfs: Fix a insane extent_buffer copy behavior for qgroup
Date: Sat, 26 Sep 2015 00:35:48 +0200	[thread overview]
Message-ID: <eb99c836513f7d88542f078a1b095d83@all.all> (raw)
In-Reply-To: <1443148681-3015-1-git-send-email-quwenruo@cn.fujitsu.com>

Le 2015-09-25 04:37, Qu Wenruo a écrit :
> Stephane Lesimple reported an qgroup rescan bug:
> 
> [92098.841309] general protection fault: 0000 [#1] SMP
> [92098.841338] Modules linked in: ...
> [92098.841814] CPU: 1 PID: 24655 Comm: kworker/u4:12 Not tainted
> 4.3.0-rc1 #1
> [92098.841868] Workqueue: btrfs-qgroup-rescan 
> btrfs_qgroup_rescan_helper
> [btrfs]
> [92098.842261] Call Trace:
> [92098.842277]  [<ffffffffc035a5d8>] ? read_extent_buffer+0xb8/0x110
> [btrfs]
> [92098.842304]  [<ffffffffc0396d00>] ? btrfs_find_all_roots+0x60/0x70
> [btrfs]
> [92098.842329]  [<ffffffffc039af3d>]
> btrfs_qgroup_rescan_worker+0x28d/0x5a0 [btrfs]
> ...
> 
> The triggering function btrfs_disk_key_to_cpu(), which should never
> fail.
> But it turned out that the extent_buffere being called on is memcpied
> from an existing one.
> 
> Such behavior to copy a structure with page pointers and locks in it is
> never a sane thing.
> 
> Fix it by do it in memory other than extent_buffer.
> 
> Qu Wenruo (2):
>   btrfs: Add support to do stack item key operation
>   btrfs: qgroup: Don't copy extent buffer to do qgroup rescan
> 
>  fs/btrfs/ctree.h  | 20 ++++++++++++++++++++
>  fs/btrfs/qgroup.c | 22 ++++++++++++----------
>  2 files changed, 32 insertions(+), 10 deletions(-)

I applied this patch and ran 100+ rescans on my filesystem for several 
hours. No crash happened, where only a few rescans were enough to 
trigger the bug previously.

I'm confident this patch fixes the GPF, thanks Qu !

-- 
Stéphane.



      parent reply	other threads:[~2015-09-25 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25  2:37 [PATCH 0/2] Btrfs: Fix a insane extent_buffer copy behavior for qgroup Qu Wenruo
2015-09-25  2:38 ` [PATCH 1/2] btrfs: Add support to do stack item key operation Qu Wenruo
2015-10-01 16:46   ` David Sterba
2015-10-02  1:08     ` Qu Wenruo
2015-09-25  2:38 ` [PATCH 2/2] btrfs: qgroup: Don't copy extent buffer to do qgroup rescan Qu Wenruo
2015-09-25 22:35 ` Stéphane Lesimple [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=eb99c836513f7d88542f078a1b095d83@all.all \
    --to=stephane_btrfs@lesimple.fr \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).