From: Josef Bacik Date: Wed, 5 Sep 2012 14:08:30 +0000 (-0600) Subject: Btrfs: move the sb_end_intwrite until after the throttle logic X-Git-Tag: v3.7-rc1~71^2~55 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6df7881a84013f91405e5e113a4c322dd1804ba6;p=pandora-kernel.git Btrfs: move the sb_end_intwrite until after the throttle logic Sage reported the following lockdep backtrace ===================================== [ BUG: bad unlock balance detected! ] 3.6.0-rc2-ceph-00171-gc7ed62d #1 Not tainted ------------------------------------- btrfs-cleaner/7607 is trying to release lock (sb_internal) at: [] btrfs_commit_transaction+0xa6e/0xb20 [btrfs] but there are no more locks to release! other info that might help us debug this: 1 lock held by btrfs-cleaner/7607: #0: (&fs_info->cleaner_mutex){+.+...}, at: [] cleaner_kthread+0x95/0x120 [btrfs] stack backtrace: Pid: 7607, comm: btrfs-cleaner Not tainted 3.6.0-rc2-ceph-00171-gc7ed62d #1 Call Trace: [] ? btrfs_commit_transaction+0xa6e/0xb20 [btrfs] [] print_unlock_inbalance_bug+0xfe/0x110 [] lock_release_non_nested+0x1ee/0x310 [] ? kmem_cache_free+0x7b/0x160 [] ? put_transaction+0x8c/0x130 [btrfs] [] ? btrfs_commit_transaction+0xa6e/0xb20 [btrfs] [] lock_release+0xd5/0x220 [] ? kmem_cache_free+0x151/0x160 [] __sb_end_write+0x7d/0x90 [] btrfs_commit_transaction+0xa6e/0xb20 [btrfs] [] ? __init_waitqueue_head+0x60/0x60 [] ? _raw_spin_unlock+0x2b/0x40 [] __btrfs_end_transaction+0x368/0x3c0 [btrfs] [] btrfs_end_transaction_throttle+0x18/0x20 [btrfs] [] btrfs_drop_snapshot+0x410/0x600 [btrfs] [] ? do_raw_spin_unlock+0x5d/0xb0 [] btrfs_clean_old_snapshots+0xaf/0x150 [btrfs] [] ? cleaner_kthread+0x95/0x120 [btrfs] [] cleaner_kthread+0xa9/0x120 [btrfs] [] ? btrfs_destroy_delayed_refs.isra.102+0x220/0x220 [btrfs] [] kthread+0xae/0xc0 [] ? trace_hardirqs_on+0xd/0x10 [] kernel_thread_helper+0x4/0x10 [] ? retint_restore_args+0x13/0x13 [] ? flush_kthread_work+0x1a0/0x1a0 [] ? gs_change+0x13/0x13 This is because the throttle stuff can commit the transaction, which expects to be the one stopping the intwrite stuff, but we've already done it in the __btrfs_end_transaction. Moving the sb_end_intewrite after this logic makes the lockdep go away. Thanks, Tested-by: Sage Weil Signed-off-by: Josef Bacik --- Reading git-diff-tree failed