linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Mathieu Chouquet-Stringer <mathieu@csetco.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Btrfs bug with g38867a2 and a question
Date: Wed, 21 Sep 2011 16:18:29 -0400	[thread overview]
Message-ID: <4E7A4695.9080106@redhat.com> (raw)
In-Reply-To: <20110921185350.GA6618@kashmir>

On 09/21/2011 02:53 PM, Mathieu Chouquet-Stringer wrote:
> 	Hello all,
> 
> I've been using BTRFS for quite some time on this laptop and I just
> recompiled the latest kernel from git (3.1.0-rc6-00247-g38867a2).  After
> a couple minutes, I hit this bug twice (this a hand written transcript,
> pics here [1]) kernel BUG at fs/btrfs/inode.c:785!
> 
> stack being:
> 
> _raw_spin_unlock_irqrestore
> __wake_up
> btrfs_tree_read_unlock_blocking
> free_extent_buffer
> run_delalloc_nocow
> run_dellaloc_range
> free_extent_state
> find_lock_delalloc_range.constrpop
> __extent_writepage
> ...
> 
> Note the stack trace is exactly the same in these two crashes.  Since
> google found nothing, I'm asking for your help!
> 
> Looking at the source, line 785 is function cow_file_range, code:
> BUG_ON(btrfs_is_free_space_inode(root, inode));
> 
> My fs (a simple partition on a OCZ-VERTEX2 ssd) is mounted with the
> following options:
> ssd,discard,autodefrag
> 
> with disk space caching as it had been added earlier:
> btrfs: disk space caching is enabled
> Btrfs detected SSD devices, enabling SSD mode
> 
> Anything I could do to help debug this one?

Yup, can you apply this patch and reproduce?  It will print out some
debug info before the --- cut here --- line, which is what I need.  Thanks,

Josef

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b128fa0..66ba0a7 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -782,7 +782,12 @@ static noinline int cow_file_range(struct inode *inode,
 	struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
 	int ret = 0;

-	BUG_ON(btrfs_is_free_space_inode(root, inode));
+	if (btrfs_is_free_space_inode(root, inode)) {
+		printk(KERN_ERR "trying to write to free space inode, "
+		       "isize=%Lu, start=%Lu, end=%Lu\n", i_size_read(inode),
+		       start, end);
+		BUG_ON(btrfs_is_free_space_inode(root, inode));
+	}
 	trans = btrfs_join_transaction(root);
 	BUG_ON(IS_ERR(trans));
 	trans->block_rsv = &root->fs_info->delalloc_block_rsv;

  reply	other threads:[~2011-09-21 20:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 18:53 Btrfs bug with g38867a2 and a question Mathieu Chouquet-Stringer
2011-09-21 20:18 ` Josef Bacik [this message]
2011-09-21 20:35   ` Mathieu Chouquet-Stringer
2011-09-21 23:10   ` David Sterba
2011-09-22 10:13     ` Mathieu Chouquet-Stringer
2011-09-22 11:05       ` David Sterba
2011-09-22 11:35         ` Mathieu Chouquet-Stringer
     [not found]     ` <CALiWzOg8CQJF7OfMex1uJTa+doDZ8oufV1nAbos99Z4ev-+xKg@mail.gmail.com>
2011-09-22 14:12       ` Josef Bacik
2011-09-22 15:16         ` Mathieu Chouquet-Stringer
2011-09-22 18:22         ` Mathieu Chouquet-Stringer
2011-09-22 19:00           ` Josef Bacik
2011-09-22 19:30             ` Mathieu Chouquet-Stringer
2011-09-22 20:32               ` Mathieu Chouquet-Stringer
2011-09-23 12:55                 ` Mathieu Chouquet-Stringer
2011-09-23 14:49                   ` Josef Bacik
2011-09-23 15:31                     ` Mathieu Chouquet-Stringer
2011-09-23 15:34                       ` Josef Bacik
2011-09-23 17:16                         ` Mathieu Chouquet-Stringer

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=4E7A4695.9080106@redhat.com \
    --to=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mathieu@csetco.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).