All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Ric Wheeler <ricwheeler@gmail.com>
Cc: Ric Wheeler <rwheeler@redhat.com>, linux-btrfs@vger.kernel.org
Subject: Re: btrfs panic - BUG: soft lockup - CPU#0 stuck for 61s! [fs_mark:4573]
Date: Wed, 4 Jun 2008 16:12:00 -0400	[thread overview]
Message-ID: <20080604201200.GB26959@think.oraclecorp.com> (raw)
In-Reply-To: <4846F102.3000801@gmail.com>

On Wed, Jun 04, 2008 at 03:46:10PM -0400, Ric Wheeler wrote:
> Chris Mason wrote:
>> On Mon, Jun 02, 2008 at 01:52:47PM -0400, Ric Wheeler wrote:
>>   
>>> I can reliably get btrfs to panic by running my fs_mark code on a 
>>> newly  created file system with lots of threads on an 8-way box. If 
>>> this is too  aggressive, let me know ;-)
>>>
>>> Here is a summary of the panic:
>>>     
>>
>> I think this is due to a corruption on the data=ordered list.  I'm
>> testing a patch out here.
>>
>> -chris
>>   
> I can test it tomorrow if you send it on... Thanks!

Patch is below, but I don't have access to my test rig so I haven't
hammered on it yet.  I'm willing to corrupt Ric's test box, but everyone
else may want to wait ;)

-chris

diff -r 0b4ab489ffe1 file.c
--- a/file.c	Tue May 27 10:55:43 2008 -0400
+++ b/file.c	Wed Jun 04 16:10:40 2008 -0400
@@ -980,7 +980,7 @@ out_nolock:
 
 static int btrfs_release_file (struct inode * inode, struct file * filp)
 {
-	btrfs_del_ordered_inode(inode);
+	btrfs_del_ordered_inode(inode, 0);
 	return 0;
 }
 
diff -r 0b4ab489ffe1 inode.c
--- a/inode.c	Tue May 27 10:55:43 2008 -0400
+++ b/inode.c	Wed Jun 04 16:10:40 2008 -0400
@@ -861,7 +861,7 @@ static int btrfs_unlink(struct inode *di
 		 * we don't need to worry about
 		 * data=ordered
 		 */
-		btrfs_del_ordered_inode(inode);
+		btrfs_del_ordered_inode(inode, 0);
 	}
 
 	btrfs_end_transaction(trans, root);
@@ -3352,6 +3352,7 @@ void btrfs_destroy_inode(struct inode *i
 	WARN_ON(!list_empty(&inode->i_dentry));
 	WARN_ON(inode->i_data.nrpages);
 
+	btrfs_del_ordered_inode(inode, 1);
 	btrfs_drop_extent_cache(inode, 0, (u64)-1);
 	kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
 }
diff -r 0b4ab489ffe1 ordered-data.c
--- a/ordered-data.c	Tue May 27 10:55:43 2008 -0400
+++ b/ordered-data.c	Wed Jun 04 16:10:40 2008 -0400
@@ -254,7 +254,7 @@ static void __btrfs_del_ordered_inode(st
 	return;
 }
 
-void btrfs_del_ordered_inode(struct inode *inode)
+void btrfs_del_ordered_inode(struct inode *inode, int force)
 {
 	struct btrfs_root *root = BTRFS_I(inode)->root;
 	u64 root_objectid = root->root_key.objectid;
@@ -263,8 +263,8 @@ void btrfs_del_ordered_inode(struct inod
 		return;
 	}
 
-	if (mapping_tagged(inode->i_mapping, PAGECACHE_TAG_DIRTY) ||
-	    mapping_tagged(inode->i_mapping, PAGECACHE_TAG_WRITEBACK))
+	if (!force && (mapping_tagged(inode->i_mapping, PAGECACHE_TAG_DIRTY) ||
+	    mapping_tagged(inode->i_mapping, PAGECACHE_TAG_WRITEBACK)))
 		return;
 
 	spin_lock(&root->fs_info->new_trans_lock);
diff -r 0b4ab489ffe1 ordered-data.h
--- a/ordered-data.h	Tue May 27 10:55:43 2008 -0400
+++ b/ordered-data.h	Wed Jun 04 16:10:40 2008 -0400
@@ -38,6 +38,6 @@ int btrfs_find_first_ordered_inode(struc
 int btrfs_find_first_ordered_inode(struct btrfs_ordered_inode_tree *tree,
 				       u64 *root_objectid, u64 *objectid,
 				       struct inode **inode);
-void btrfs_del_ordered_inode(struct inode *inode);
+void btrfs_del_ordered_inode(struct inode *inode, int force);
 int btrfs_ordered_throttle(struct btrfs_root *root, struct inode *inode);
 #endif

  reply	other threads:[~2008-06-04 20:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02 17:52 btrfs panic - BUG: soft lockup - CPU#0 stuck for 61s! [fs_mark:4573] Ric Wheeler
2008-06-04  1:27 ` Chris Mason
2008-06-04 19:46   ` Ric Wheeler
2008-06-04 20:12     ` Chris Mason [this message]
2008-06-05 14:34 ` Chris Mason
2008-06-05 15:16   ` Ric Wheeler
     [not found]   ` <484825D4.2010402@redhat.com>
2008-06-09  2:37     ` Chris Mason
2008-06-09 13:51       ` Ric Wheeler
2008-06-10  0:10       ` Mingming Cao
2008-06-10  0:47         ` Chris Mason
2008-06-10 18:38           ` Mingming Cao

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=20080604201200.GB26959@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=ricwheeler@gmail.com \
    --cc=rwheeler@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.