All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Filipe David Manana <fdmanana@gmail.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 0/4] btrfs: reduce block group cache writeout times during commit
Date: Fri, 24 Apr 2015 09:33:30 -0400	[thread overview]
Message-ID: <20150424133330.GA2412@ret.masoncoding.com> (raw)
In-Reply-To: <CAL3q7H7sM9Z4AbyuJUy5A9PkhrfOB=eQq_2ZRu9nRgjOwkVA6w@mail.gmail.com>

On Fri, Apr 24, 2015 at 07:34:43AM +0100, Filipe David Manana wrote:
> There's also one list corruption I didn't get before and happened
> while running fsstress (btrfs/078), apparently due to some race:
> 
> [25590.799058] ------------[ cut here ]------------
> [25590.800204] WARNING: CPU: 3 PID: 7280 at lib/list_debug.c:62
> __list_del_entry+0x5a/0x98()
> [25590.802101] list_del corruption. next->prev should be
> ffff8801a0f74d50, but was a56b6b6b6b6b6b6b
> [25590.804236] Modules linked in: btrfs dm_flakey dm_mod
> crc32c_generic xor raid6_pq nfsd auth_rpcgss oid_registry nfs_acl nfs
> lockd grace fscache sunrpc loop fuse i2c_piix4 i2c_core psmouse
> serio_raw evdev parport_pc parport acpi_cpufreq processor button
> pcspkr thermal_sys microcode ext4 crc16 jbd2 mbcache sd_mod sg sr_mod
> cdrom virtio_scsi ata_generic virtio_pci virtio_ring ata_piix e1000
> virtio libata floppy scsi_mod [last unloaded: btrfs]
> [25590.818580] CPU: 3 PID: 7280 Comm: fsstress Tainted: G        W
>   4.0.0-rc5-btrfs-next-9+ #1
> [25590.820597] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
> BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org
> 04/01/2014
> [25590.823458]  0000000000000009 ffff8803f031bc08 ffffffff8142fa46
> ffffffff8108b6a2
> [25590.825081]  ffff8803f031bc58 ffff8803f031bc48 ffffffff81045ea5
> 0000000000000011
> [25590.826568]  ffffffff81245af7 ffff8801a0f74d50 ffff8801a0f74460
> ffff880041710df0
> [25590.828106] Call Trace:
> [25590.828630]  [<ffffffff8142fa46>] dump_stack+0x4f/0x7b
> [25590.829706]  [<ffffffff8108b6a2>] ? console_unlock+0x361/0x3ad
> [25590.830785]  [<ffffffff81045ea5>] warn_slowpath_common+0xa1/0xbb
> [25590.831957]  [<ffffffff81245af7>] ? __list_del_entry+0x5a/0x98
> [25590.867473]  [<ffffffff81045f05>] warn_slowpath_fmt+0x46/0x48
> [25590.868631]  [<ffffffffa04907e2>] ? btrfs_csum_data+0x16/0x18 [btrfs]
> [25590.869524]  [<ffffffff81245af7>] __list_del_entry+0x5a/0x98
> [25590.870918]  [<ffffffffa04cff5f>] write_bitmap_entries+0x99/0xbd [btrfs]

Can you please see which line write_bitmap_entries+0x99 is?

I'm hoping this will fix it:

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index d773f22..5c7746f 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1119,18 +1119,21 @@ static int flush_dirty_cache(struct inode *inode)
 }
 
 static void noinline_for_stack
-cleanup_write_cache_enospc(struct inode *inode,
+cleanup_write_cache_enospc(struct btrfs_free_space_ctl *ctl,
+			   struct inode *inode,
 			   struct btrfs_io_ctl *io_ctl,
 			   struct extent_state **cached_state,
 			   struct list_head *bitmap_list)
 {
 	struct list_head *pos, *n;
 
+	spin_lock(&ctl->tree_lock);
 	list_for_each_safe(pos, n, bitmap_list) {
 		struct btrfs_free_space *entry =
 			list_entry(pos, struct btrfs_free_space, list);
 		list_del_init(&entry->list);
 	}
+	spin_unlock(&ctl->tree_lock);
 	io_ctl_drop_pages(io_ctl);
 	unlock_extent_cached(&BTRFS_I(inode)->io_tree, 0,
 			     i_size_read(inode) - 1, cached_state,
@@ -1345,7 +1348,8 @@ out:
 	return ret;
 
 out_nospc:
-	cleanup_write_cache_enospc(inode, io_ctl, &cached_state, &bitmap_list);
+	cleanup_write_cache_enospc(ctl, inode, io_ctl,
+				   &cached_state, &bitmap_list);
 
 	if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA))
 		up_write(&block_group->data_rwsem);


  parent reply	other threads:[~2015-04-24 13:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 19:52 [PATCH 0/4] btrfs: reduce block group cache writeout times during commit Chris Mason
2015-04-13 19:52 ` [PATCH 1/4] btrfs: move struct io_ctl into ctree.h and rename it Chris Mason
2015-04-13 19:52 ` [PATCH 2/4] Btrfs: two stage dirty block group writeout Chris Mason
2015-04-13 19:52 ` [PATCH 3/4] Btrfs: don't use highmem for free space cache pages Chris Mason
2015-04-13 19:52 ` [PATCH 4/4] Btrfs: allow block group cache writeout outside critical section in commit Chris Mason
2015-04-22 16:09 ` [PATCH 0/4] btrfs: reduce block group cache writeout times during commit Lutz Vieweg
2015-04-22 16:37   ` Holger Hoffstätte
2015-04-22 16:55     ` Chris Mason
2015-04-23 12:45       ` Filipe David Manana
2015-04-23 12:52         ` Chris Mason
2015-04-23 12:56           ` Chris Mason
2015-04-23 13:05           ` Filipe David Manana
2015-04-23 15:17             ` Chris Mason
2015-04-23 15:48               ` Filipe David Manana
2015-04-23 19:43                 ` Filipe David Manana
2015-04-23 19:50                   ` Chris Mason
2015-04-24  6:34                     ` Filipe David Manana
2015-04-24 13:00                       ` Chris Mason
2015-04-24 13:43                         ` Filipe David Manana
2015-04-24 13:55                           ` Chris Mason
2015-04-24 15:05                             ` Filipe David Manana
2015-04-25 17:33                               ` Filipe David Manana
2015-04-24 13:33                       ` Chris Mason [this message]
2015-04-23 16:34       ` Holger Hoffstätte
2015-04-23 17:57         ` Chris Mason
2015-06-26 17:12   ` Lutz Vieweg

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=20150424133330.GA2412@ret.masoncoding.com \
    --to=clm@fb.com \
    --cc=fdmanana@gmail.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 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.