Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Chandan Rajendra <chandan@linux.vnet.ibm.com>
To: Chris Mason <clm@fb.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: make sure we stay inside the bvec during __btrfs_lookup_bio_sums
Date: Mon, 21 Mar 2016 22:32:33 +0530	[thread overview]
Message-ID: <10889043.sdhK3zvePA@localhost.localdomain> (raw)
In-Reply-To: <20160321150014.hod3ktlnpaxbx2u7@floor.thefacebook.com>

On Monday 21 Mar 2016 11:00:14 Chris Mason wrote:
> Hi everyone,
> 
> I realized last week that CONFIG_DEBUG_PAGEALLOC had dropped out of my
> config, and hit a crash inside __btrfs_lookup_bio_sums once I enabled it
> again.  It's hard for this bug to cause problems because Chandan's inner
> loop is always done at the same time the outer loop is done.  Without my
> goto, it's just exiting normally, but only after reading bvec->bv_len
> (which isn't valid).
> 
> I have this on top of my integration-4.6.  Once things pass I'll
> send a pull later today or Tuesday morning:
> 
> Commit c40a3d38aff4e1c (Btrfs: Compute and look up csums based on
> sectorsized blocks) changes around how we walk the bios while looking up
> crcs.  There's an inner loop that is jumping to the next bvec based on
> sectors and before it derefs the next bvec, it needs to make sure we're
> still in the bio.
> 
> In this case, the outer loop would have decided to stop moving forward
> too, and the bvec deref is never actually used for anything.  But
> CONFIG_DEBUG_PAGEALLOC catches it because we're outside our bio.
>

Chris, Thanks for finding the issue and fixing it. From now onwards, I will
make sure that I have CONFIG_DEBUG_PAGEALLOC enabled on my test kernel build
config.

Reviewed-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>

-- 
chandan


      reply	other threads:[~2016-03-21 17:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 15:00 [PATCH] btrfs: make sure we stay inside the bvec during __btrfs_lookup_bio_sums Chris Mason
2016-03-21 17:02 ` Chandan Rajendra [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=10889043.sdhK3zvePA@localhost.localdomain \
    --to=chandan@linux.vnet.ibm.com \
    --cc=clm@fb.com \
    --cc=linux-btrfs@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