fs,btrfs: fix rt deadlock on extent_buffer->lock
PATCH 1/4 fs,btrfs: fix rt deadlock on extent_buffer->lock
In reply to a message not in the archive3.14.34-rt32-rc2ls stable review patch.
If anyone has any objections, please let me know.
------------------
3.14.34-rt32-rc2 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Mike Galbraith <[email protected]>
Sat Jul 14 12:30:41 CEST 2012
Trivially repeatable deadlock is cured by enabling lockdep code in btrfs_clear_path_blocking() as suggested by Chris Mason. He also suggested restricting blocking reader count to one, and not allowing a spinning reader while blocking reader exists. This has proven to be unnecessary, the strict lock order enforcement is enough.. or rather that's my box's opinion after long hours of hard pounding.
Note: extent-tree.c bit is additional recommendation from Chris
Mason, split into a separate patch after discussion.
--- fs/btrfs/ctree.c | 4 ++-- fs/btrfs/extent-tree.c | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-)
fs/btrfs/ctree.c +2 -2
@@ -80,7 +80,7 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p, {int i; -#ifdef CONFIG_DEBUG_LOCK_ALLOC +#if (defined(CONFIG_DEBUG_LOCK_ALLOC ) || defined(CONFIG_PREEMPT_RT_BASE ))/* lockdep really cares that we take all of these spinlocks * in the right order. If any of the locks in the path are not * currently blocking, it is going to complain. So, make really
@@ -107,7 +107,7 @@ noinline void btrfs_clear_path_blocking(struct btrfs_path *p, } } -#ifdef CONFIG_DEBUG_LOCK_ALLOC +#if (defined(CONFIG_DEBUG_LOCK_ALLOC ) || defined(CONFIG_PREEMPT_RT_BASE ))if (held)btrfs_clear_lock_blocking_rw (held, held_rw);#endif
fs/btrfs/extent-tree.c +0 -8
@@ -6940,14 +6940,6 @@ again: goto again; } -if (btrfs_test_opt (root,ENOSPC_DEBUG )) { - static DEFINE_RATELIMIT_STATE(_rs, - DEFAULT_RATELIMIT_INTERVAL * 10, - /*DEFAULT_RATELIMIT_BURST*/ 1); -if (__ratelimit (&_rs)) -WARN (1 ,KERN_DEBUG -"BTRFS: block rsv returned %d\n" , ret); - } try_reserve: ret =reserve_metadata_bytes (root, block_rsv, blocksize,BTRFS_RESERVE_NO_FLUSH );
Signature · 1 line
2.1.4