linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Andrea Righi <andrea.righi@canonical.com>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: raid56: properly unmap parity page in finish_parity_scrub()
Date: Mon, 18 Mar 2019 19:47:20 +0100	[thread overview]
Message-ID: <20190318184720.GF3516@twin.jikos.cz> (raw)
In-Reply-To: <20190314075628.GA11282@xps-13>

On Thu, Mar 14, 2019 at 08:56:28AM +0100, Andrea Righi wrote:
> Parity page is incorrectly unmapped in finish_parity_scrub(), triggering
> a reference counter bug on i386, i.e.:
> 
>  [ 157.662401] kernel BUG at mm/highmem.c:349!
>  [ 157.666725] invalid opcode: 0000 [#1] SMP PTI
> 
> The reason is that kunmap(p_page) was completely left out, so we never
> did an unmap for the p_page and the loop unmapping the rbio page was
> iterating over the wrong number of stripes: unmapping should be done
> with nr_data instead of rbio->real_stripes.
> 
> Test case to reproduce the bug:
> 
>  - create a raid5 btrfs filesystem:
>    # mkfs.btrfs -m raid5 -d raid5 /dev/sdb /dev/sdc /dev/sdd /dev/sde
> 
>  - mount it:
>    # mount /dev/sdb /mnt
> 
>  - run btrfs scrub in a loop:
>    # while :; do btrfs scrub start -BR /mnt; done
> 
> BugLink: https://bugs.launchpad.net/bugs/1812845
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> Signed-off-by: Andrea Righi <andrea.righi@canonical.com>

Reviewed-by: David Sterba <dsterba@suse.com>

Thanks.

      reply	other threads:[~2019-03-18 18:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 10:17 [PATCH] btrfs: raid56: properly unmap parity page in finish_parity_scrub() Andrea Righi
2019-03-13 10:59 ` Johannes Thumshirn
2019-03-14  7:56 ` [PATCH v2] " Andrea Righi
2019-03-18 18:47   ` David Sterba [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=20190318184720.GF3516@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=andrea.righi@canonical.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).