public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix write_dev_supers
Date: Tue, 9 Jun 2009 07:25:16 -0400	[thread overview]
Message-ID: <20090609112516.GB4009@think> (raw)
In-Reply-To: <6.0.0.20.2.20090608181508.05e4b708@172.19.0.2>

On Tue, Jun 09, 2009 at 10:46:55AM +0900, Hisashi Hifumi wrote:
> Hi.
> 
> I got following BUG trace.
> This is violation of BUG_ON(!buffer_locked(bh)) check on submit_bh() function.
> In write_dev_supers(), if wait parameter is set and buffer_uptodate() check
> is negative,  submit_bh() is executed and hit above BUG_ON.
> So I fixed this issue.

Thanks for finding this bug and sending the patch.

This function is very confusing.  If wait parameter is set, it
isn't supposed to do any IO at all.  The caller first does
write_dev_supers with wait == 0, and that sends all the supers down on
all the devices.

Then it calls again with wait == 1, which is supposed to make sure all
the supers actually got to disk.

We should change the wait == 0 behavior to leave a reference held on all
the buffers, and wait == 1 to drop that reference.  That way the buffer
won't disappear while we are waiting, and we can return an error if the
buffer wasn't up to date when wait == 1.

Are you interested in fixing this?

-chris

  reply	other threads:[~2009-06-09 11:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09  1:46 [PATCH] btrfs: fix write_dev_supers Hisashi Hifumi
2009-06-09 11:25 ` Chris Mason [this message]
2009-06-09 11:28   ` Hisashi Hifumi
2009-06-10  7:32   ` Hisashi Hifumi
2009-06-10 21:02     ` Chris Mason

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=20090609112516.GB4009@think \
    --to=chris.mason@oracle.com \
    --cc=hifumi.hisashi@oss.ntt.co.jp \
    --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